/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
require_once('./global.php');
require_once('./includes/api_automation.php');
-require_once('./includes/class_api_error.php');
APIError(array(new API_Error_Handler($admin), 'admin_error'));
NavLinks::fieldsPages();
if ($_REQUEST['do'] == 'kill')
{
- $action = new AutomationAPI($bugsys);
- $action->set('actionid', $bugsys->in['actionid']);
+ $action = new AutomationAPI();
+ $action->set('actionid', $input->in['actionid']);
$action->set_condition();
$action->delete();
if ($_REQUEST['do'] == 'delete')
{
- $admin->page_confirm(T('Are you sure you want to delete this automation?'), 'automation.php', 'kill', array('actionid' => $bugsys->in['actionid']));
+ $admin->page_confirm(T('Are you sure you want to delete this automation?'), 'automation.php', 'kill', array('actionid' => $input->in['actionid']));
}
// ###################################################################
{
$deltas = array('builtin' => array(), 'custom' => array());
- if (is_array($bugsys->in['fields']))
+ if (is_array($input->in['fields']))
{
- foreach ($bugsys->in['fields'] AS $key => $value)
+ foreach ($input->in['fields'] AS $key => $value)
{
if (!empty($value) AND $value != -1 AND !is_array($value))
{
}
}
- if (is_array($bugsys->in['fields']['custom']))
+ if (is_array($input->in['fields']['custom']))
{
- foreach ($bugsys->in['fields']['custom'] AS $key => $value)
+ foreach ($input->in['fields']['custom'] AS $key => $value)
{
if ($value != '' AND $value != -1)
{
}
}
- $action = new AutomationAPI($bugsys);
- $action->set('name', $bugsys->in['name']);
- $action->set('description', $bugsys->in['description']);
+ $action = new AutomationAPI();
+ $action->set('name', $input->in['name']);
+ $action->set('description', $input->in['description']);
$action->set('fieldchanges', $deltas);
- $action->set('comment', $bugsys->in['comment']);
+ $action->set('comment', $input->in['comment']);
if ($_POST['do'] == 'insert')
{
}
else
{
- $action->set('actionid', $bugsys->in['actionid']);
+ $action->set('actionid', $input->in['actionid']);
$action->set_condition();
$action->update();
if ($edit)
{
- NavLinks::automationsEdit($bugsys->in['actionid']);
+ NavLinks::automationsEdit($input->in['actionid']);
$navigator->set_focus('link', 'fields-pages-automations', 'fields-pages');
- $action = new AutomationAPI($bugsys);
- $action->set('actionid', $bugsys->in['actionid']);
+ $action = new AutomationAPI();
+ $action->set('actionid', $input->in['actionid']);
$action->set_condition();
$action->fetch();
- $action->objdata['fields'] = unserialize($action->objdata['fieldchanges']);
+ $action->record['fields'] = unserialize($action->record['fieldchanges']);
}
else
{
if ($edit)
{
- $admin->form_hidden_field('actionid', $action->objdata['actionid']);
+ $admin->form_hidden_field('actionid', $action->record['actionid']);
}
$admin->table_start();
$admin->table_head(($add ? T('New Automation') : T('Edit Automation')));
- $admin->row_input(T('Name'), 'name', $action->objdata['name']);
- $admin->row_textarea(T('Description'), 'description', $action->objdata['description']);
- $admin->row_textarea(T('Add Comment'), 'comment', $action->objdata['comment']);
+ $admin->row_input(T('Name'), 'name', $action->record['name']);
+ $admin->row_textarea(T('Description'), 'description', $action->record['description']);
+ $admin->row_textarea(T('Add Comment'), 'comment', $action->record['comment']);
$admin->row_span(T('Field Changes'), 'thead', 'center');
// -------------------------------------------------------------------
// built-in fields
- construct_datastore_select('severity', 'severity', 'severityid', $action->objdata['fields']['builtin']['severity'], true, true);
+ construct_datastore_select('severity', 'severity', 'severityid', $action->record['fields']['builtin']['severity'], true, true);
$admin->row_list(T('Severity'), 'fields[severity]');
- construct_datastore_select('priority', 'priority', 'priorityid', $action->objdata['fields']['builtin']['priority'], true, true);
+ construct_datastore_select('priority', 'priority', 'priorityid', $action->record['fields']['builtin']['priority'], true, true);
$admin->row_list(T('Priority'), 'fields[priority]');
- construct_datastore_select('status', 'status', 'statusid', $action->objdata['fields']['builtin']['status'], true, true);
+ construct_datastore_select('status', 'status', 'statusid', $action->record['fields']['builtin']['status'], true, true);
$admin->row_list(T('Status'), 'fields[status]');
- construct_datastore_select('resolution', 'resolution', 'resolutionid', $action->objdata['fields']['builtin']['resolution'], true, true);
+ construct_datastore_select('resolution', 'resolution', 'resolutionid', $action->record['fields']['builtin']['resolution'], true, true);
$admin->row_list(T('Resolution'), 'fields[resolution]');
$admin->row_span('', 'tcat', 'center');
// -------------------------------------------------------------------
// custom fields
$fields_fetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield ORDER BY fieldid ASC");
- while ($field = $db->fetch_array($fields_fetch))
+ foreach ($fields_fetch as $field)
{
switch ($field['type'])
{
case 'input_text':
- $admin->row_input($field['name'], "fields[custom][$field[fieldid]]", $action->objdata['fields']['custom']["$field[fieldid]"]);
+ $admin->row_input($field['name'], "fields[custom][$field[fieldid]]", $action->record['fields']['custom']["$field[fieldid]"]);
break;
case 'input_checkbox':
- $admin->list_item('', -1, (!$action->objdata['fields']['custom']["$field[fieldid]"] OR $action->objdata['fields']['custom']["$field[fieldid]"] == -1));
- $admin->list_item(T('Checked'), 1, ($action->objdata['fields']['custom']["$field[fieldid]"] == 1));
- $admin->list_item(T('Un-Checked'), 0, (isset($action->objdata['fields']['custom']["$field[fieldid]"]) AND $action->objdata['fields']['custom']["$field[fieldid]"] == 0));
+ $admin->list_item('', -1, (!$action->record['fields']['custom']["$field[fieldid]"] OR $action->record['fields']['custom']["$field[fieldid]"] == -1));
+ $admin->list_item(T('Checked'), 1, ($action->record['fields']['custom']["$field[fieldid]"] == 1));
+ $admin->list_item(T('Un-Checked'), 0, (isset($action->record['fields']['custom']["$field[fieldid]"]) AND $action->record['fields']['custom']["$field[fieldid]"] == 0));
$admin->row_list($field['name'], "fields[custom][$field[fieldid]]");
break;
case 'select_single':
$selectopts = unserialize($field['selects']);
- $admin->list_item('', -1, (!isset($action->objdata['fields']['custom']["$field[fieldid]"]) OR $action->objdata['fields']['custom']["$field[fieldid]"] == -1));
+ $admin->list_item('', -1, (!isset($action->record['fields']['custom']["$field[fieldid]"]) OR $action->record['fields']['custom']["$field[fieldid]"] == -1));
foreach ($selectopts AS $id => $select)
{
- $admin->list_item(stripslashes($select), $id, (isset($action->objdata['fields']['custom']["$field[fieldid]"]) AND $action->objdata['fields']['custom']["$field[fieldid]"] == $id));
+ $admin->list_item(stripslashes($select), $id, (isset($action->record['fields']['custom']["$field[fieldid]"]) AND $action->record['fields']['custom']["$field[fieldid]"] == $id));
}
$admin->row_list($field['name'], "fields[custom][$field[fieldid]]");
break;
$admin->table_head(T('Automations'));
$actions = $db->query("SELECT * FROM " . TABLE_PREFIX . "automation ORDER BY name ASC");
- while ($action = $db->fetch_array($actions))
+ foreach ($actions as $action)
{
$admin->row_text($action['name'] . "\n<div class=\"smallfont\">$action[description]</div>", "<a href=\"automation.php?do=edit&actionid=$action[actionid]\">[" . T('Edit') . "]</a> <a href=\"automation.php?do=delete&actionid=$action[actionid]\">[" . T('Delete') . "]</a>");
}
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
require_once('./global.php');
require_once('./includes/api_field.php');
-require_once('./includes/class_api_error.php');
APIError(array(new API_Error_Handler($admin), 'admin_error'));
NavLinks::fieldsPages();
if ($_REQUEST['do'] == 'kill')
{
- $field = new FieldAPI($bugsys);
- $field->set('fieldid', $bugsys->in['fieldid']);
+ $field = new FieldAPI();
+ $field->set('fieldid', $input->in['fieldid']);
$field->set_condition();
$field->delete();
if ($_REQUEST['do'] == 'delete')
{
- $admin->page_confirm(T('Are you sure you want to delete this bug field? Doing so will remove everything for this field and it cannot be undone!'), 'field.php', 'kill', array('fieldid' => $bugsys->in['fieldid']));
+ $admin->page_confirm(T('Are you sure you want to delete this bug field? Doing so will remove everything for this field and it cannot be undone!'), 'field.php', 'kill', array('fieldid' => $input->in['fieldid']));
}
// ###################################################################
$edit = false;
$add = true;
- $type = $bugsys->in['type'];
+ $type = $input->in['type'];
- $field = new FieldAPI($bugsys);
+ $field = new FieldAPI();
- if ($bugsys->in['fieldid'])
+ if ($input->in['fieldid'])
{
- $field->set('fieldid', $bugsys->in['fieldid']);
+ $field->set('fieldid', $input->in['fieldid']);
$field->set_condition();
$field->fetch();
$edit = true;
$add = false;
- $type = $field->objdata['type'];
+ $type = $field->record['type'];
}
else
{
switch ($type)
{
case 'input_text':
- $field->set('defaultvalue', $bugsys->in['defaultvalue']);
- $field->set('regexmatch', $bugsys->in['regexmatch']);
- $field->set('maxlength', $bugsys->in['maxlength']);
+ $field->set('defaultvalue', $input->in['defaultvalue']);
+ $field->set('regexmatch', $input->in['regexmatch']);
+ $field->set('maxlength', $input->in['maxlength']);
break;
case 'input_checkbox':
- $field->set('defaultvalue', $bugsys->in['defaultvalue']);
+ $field->set('defaultvalue', $input->in['defaultvalue']);
break;
case 'select_single':
- $field->set('selects', $bugsys->in['selects']);
- $field->set('usedefault', $bugsys->in['usedefault']);
+ $field->set('selects', $input->in['selects']);
+ $field->set('usedefault', $input->in['usedefault']);
break;
}
- $field->set('name', $bugsys->in['name']);
- $field->set('description', $bugsys->in['description']);
- $field->set('required', $bugsys->in['required']);
- $field->set('cansearch', $bugsys->in['cansearch']);
+ $field->set('name', $input->in['name']);
+ $field->set('description', $input->in['description']);
+ $field->set('required', $input->in['required']);
+ $field->set('cansearch', $input->in['cansearch']);
if ($add)
{
$fieldid = $field->values['fieldid'];
}
- $bugsys->input_clean('custom', TYPE_UINT);
- foreach ($bugsys->in['custom'] AS $usergroupid => $mask)
+ $input->inputClean('custom', TYPE_UINT);
+ foreach ($input->in['custom'] AS $usergroupid => $mask)
{
$values[] = $bugsys->clean($usergroupid, TYPE_UINT) . ", $fieldid, " . $mask;
}
if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
{
- $field = new FieldAPI($bugsys);
+ $field = new FieldAPI();
$add = (($_REQUEST['do'] == 'add') ? true : false);
- $typeselect = (($add AND empty($bugsys->in['step'])) ? true : false);
+ $typeselect = (($add AND empty($input->in['step'])) ? true : false);
$edit = (($add) ? false : true);
if ($add)
}
else
{
- NavLinks::fieldsEdit($bugsys->in['fieldid']);
+ NavLinks::fieldsEdit($input->in['fieldid']);
$navigator->set_focus('link', 'fields-pages-fields', 'fields-pages');
}
$admin->form_start('field.php', ($typeselect ? 'add' : 'update'));
if ($add AND !$typeselect)
{
- $admin->form_hidden_field('type', $bugsys->in['type']);
+ $admin->form_hidden_field('type', $input->in['type']);
}
if ($typeselect)
{
else
{
$admin->table_start();
- $admin->table_head(($add ? T('Add New Bug Field') . ' - ' . FieldAPI::field_types($bugsys->in['type']) : T('Edit Field')));
+ $admin->table_head(($add ? T('Add New Bug Field') . ' - ' . FieldAPI::field_types($input->in['type']) : T('Edit Field')));
}
if ($edit)
{
- $field->set('fieldid', $bugsys->in['fieldid']);
+ $field->set('fieldid', $input->in['fieldid']);
$field->set_condition();
$field->fetch();
- $admin->form_hidden_field('fieldid', $field->objdata['fieldid']);
+ $admin->form_hidden_field('fieldid', $field->record['fieldid']);
}
if (!$typeselect)
{
- $type = (($add) ? $bugsys->in['type'] : $field->objdata['type']);
+ $type = (($add) ? $input->in['type'] : $field->record['type']);
}
// show type selector
- if (empty($bugsys->in['step']) AND $add)
+ if (empty($input->in['step']) AND $add)
{
foreach (FieldAPI::field_types() AS $name => $description)
{
// global fields
$admin->row_span(T('Global Fields'), 'thead', 'center');
$admin->row_text(T('Field Type'), FieldAPI::field_types($type));
- $admin->row_input(T('Display Name'), 'name', $field->objdata['name']);
- $admin->row_textarea(T('Description'), 'description', $field->objdata['description']);
- $admin->row_yesno(T('Required'), 'required', $field->objdata['required']);
- $admin->row_yesno(T('Can Be Searched'), 'cansearch', ((isset($field->objdata['cansearch'])) ? $field->objdata['cansearch'] : true));
+ $admin->row_input(T('Display Name'), 'name', $field->record['name']);
+ $admin->row_textarea(T('Description'), 'description', $field->record['description']);
+ $admin->row_yesno(T('Required'), 'required', $field->record['required']);
+ $admin->row_yesno(T('Can Be Searched'), 'cansearch', ((isset($field->record['cansearch'])) ? $field->record['cansearch'] : true));
// type-specific fields
$admin->row_span(T('Type-Specific Fields'), 'thead', 'center');
switch ($type)
{
case 'input_text':
- $admin->row_input(T('Default Value'), 'defaultvalue', $field->objdata['defaultvalue']);
- $admin->row_input(T('Regular Expression Match'), 'regexmatch', $field->objdata['regexmatch']);
- $admin->row_input(T('Maximum Length'), 'maxlength', $field->objdata['maxlength'], 2, 10);
+ $admin->row_input(T('Default Value'), 'defaultvalue', $field->record['defaultvalue']);
+ $admin->row_input(T('Regular Expression Match'), 'regexmatch', $field->record['regexmatch']);
+ $admin->row_input(T('Maximum Length'), 'maxlength', $field->record['maxlength'], 2, 10);
break;
case 'input_checkbox':
- $admin->row_yesno(T('Checked By Default'), 'defaultvalue', $field->objdata['defaultvalue']);
+ $admin->row_yesno(T('Checked By Default'), 'defaultvalue', $field->record['defaultvalue']);
break;
case 'select_single':
- $admin->row_textarea(T('Selection Values'), 'selects', stripslashes(implode("\n", (array)unserialize($field->objdata['selects']))));
- $admin->row_yesno(T('Make the First Option Default'), 'usedefault', $field->objdata['usedefault']);
+ $admin->row_textarea(T('Selection Values'), 'selects', stripslashes(implode("\n", (array)unserialize($field->record['selects']))));
+ $admin->row_yesno(T('Make the First Option Default'), 'usedefault', $field->record['usedefault']);
break;
}
if ($edit)
{
- $perms = $db->query("SELECT usergroupid, mask FROM " . TABLE_PREFIX . "bugfieldpermission WHERE fieldid = " . $field->objdata['fieldid']);
- while ($perm = $db->fetch_array($perms))
+ $perms = $db->query("SELECT usergroupid, mask FROM " . TABLE_PREFIX . "bugfieldpermission WHERE fieldid = " . $field->record['fieldid']);
+ foreach ($perms as $perm)
{
$permissions["$perm[usergroupid]"] = $perm['mask'];
}
}
$usergroups = $db->query("SELECT * FROM " . TABLE_PREFIX . "usergroup ORDER BY usergroupid");
- while ($usergroup = $db->fetch_array($usergroups))
+ foreach ($usergroups as $usergroup)
{
unset($listitem);
$admin->list_item(T('No Permission'), 0, $permissions["$usergroup[usergroupid]"] == 0);
$admin->table_column_head(array(T('Display Name/Description'), T('Field ID'), T('Actions')));
$fields = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield ORDER BY fieldid ASC");
- while ($field = $db->fetch_array($fields))
+ foreach ($fields as $field)
{
$admin->row_multi_item(
array(
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
define('ISSO_PRINTER_NO_NAVIGATION', 1);
- $admin->page_start(T('Login'), null, '', 'document.cplogin.' . ($bugsys->userinfo['email'] ? 'password' : 'email') . '.focus();');
+ $admin->page_start(T('Login'), null, '', 'document.cplogin.' . (bugdar::$userinfo['email'] ? 'password' : 'email') . '.focus();');
$admin->form_start('../login.php', 'cplogin', false, 'cplogin');
$admin->table_start(true, '425');
$admin->table_head(T('Login to Bugdar'));
- $admin->row_input(T('Email'), 'email', $bugsys->userinfo['email'], 2, 35, false, false, 'middle');
+ $admin->row_input(T('Email'), 'email', bugdar::$userinfo['email'], 2, 35, false, false, 'middle');
$admin->row_input(T('Password'), 'password', '', 2, 35, false, true, 'middle');
$admin->row_submit('', T('Login'));
$admin->table_end();
if (can_perform('canadminpanel'))
{
- $session = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'");
- if ($session AND $session['userid'] == $bugsys->userinfo['userid'] AND $session['dateline'] >= (TIMENOW - 3600))
+ $session = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'");
+ if ($session AND $session['userid'] == bugdar::$userinfo['userid'] AND $session['dateline'] >= (TIMENOW - 3600))
{
// renew the cookie
- $funct->cookie(COOKIE_PREFIX . 'adminsession', $session['sessionid'], false);
+ BSFunctions::cookie(COOKIE_PREFIX . 'adminsession', $session['sessionid'], false);
}
else
{
- $funct->cookie(COOKIE_PREFIX . 'adminsession', null);
+ BSFunctions::cookie(COOKIE_PREFIX . 'adminsession', false);
admin_login();
// do we need this message?
$admin->error(T('Invalid admin session has been terminated.'));
}
else
{
- $funct->cookie(COOKIE_PREFIX . 'adminsession', null);
+ BSFunctions::cookie(COOKIE_PREFIX . 'adminsession', false);
admin_login();
}
return '<div style="margin-top: 15px; float: ' . $stylevar['right'] . '">' . $return . '</div>';
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
if (!(defined('NO_VERSION_CHECK') AND constant('NO_VERSION_CHECK') == true))
{
- $check = @file_get_contents('http://www.bluestatic.org/versioncheck.php?prod=bugdar&ver=' . str_replace(' ', '-', $bugsys->options['trackerversion']));
+ $check = @file_get_contents('http://www.bluestatic.org/versioncheck.php?prod=bugdar&ver=' . str_replace(' ', '-', bugdar::$options['trackerversion']));
if (strpos($check, '<version-check>') !== false)
{
$check = $bugsys->xml->parse($check);
if (isset($check['version-check']['update']))
{
- $admin->page_code('<div style="background-color: white; border-color: red; border-width: 2px; border-style: solid; color: red; padding: 4px"><div style="font-size: 18px; font-weight: bold">' . T('Update Avaliable') . ':</div>' . sprintf(T('Your installation of Bugdar is out-of-date. You are running version <strong>%1$s</strong> and the latest version is <strong>%2$s</strong>. You can download the update at <a href="http://www.bluestatic.org">Blue Static\'s website</a>. You are strongly encouraged to apply all updates to fix bugs and any security issues (if present).'), $bugsys->options['trackerversion'], $check['version-check']['update']['value']) . '</div>');
+ $admin->page_code('<div style="background-color: white; border-color: red; border-width: 2px; border-style: solid; color: red; padding: 4px"><div style="font-size: 18px; font-weight: bold">' . T('Update Avaliable') . ':</div>' . sprintf(T('Your installation of Bugdar is out-of-date. You are running version <strong>%1$s</strong> and the latest version is <strong>%2$s</strong>. You can download the update at <a href="http://www.bluestatic.org">Blue Static\'s website</a>. You are strongly encouraged to apply all updates to fix bugs and any security issues (if present).'), bugdar::$options['trackerversion'], $check['version-check']['update']['value']) . '</div>');
}
else if (isset($check['version-check']['up-to-date']))
{
- $admin->page_code('<div style="background-color: white; border-color: green; border-width: 2px; border-style: solid; color: green; padding: 4px"><div style="font-size: 18px; font-weight: bold">' . T('Up-to-Date') . ':</div>' . sprintf(T('Your installation of Bugdar is up-to-date. You are running version <strong>%1$s</strong>.'), $bugsys->options['trackerversion']) . '</div>');
+ $admin->page_code('<div style="background-color: white; border-color: green; border-width: 2px; border-style: solid; color: green; padding: 4px"><div style="font-size: 18px; font-weight: bold">' . T('Up-to-Date') . ':</div>' . sprintf(T('Your installation of Bugdar is up-to-date. You are running version <strong>%1$s</strong>.'), bugdar::$options['trackerversion']) . '</div>');
}
}
}
// -------------------------------------------------------------------
$admin->row_span(T('Version Information'), 'thead');
-$admin->row_text(T('Bugdar Version'), $bugsys->options['trackerversion']);
+$admin->row_text(T('Bugdar Version'), bugdar::$options['trackerversion']);
$admin->row_text(T('PHP Version'), phpversion());
-$mysql = $db->query_first("SELECT VERSION() AS version");
+$mysql = $db->queryFirst("SELECT VERSION() AS version");
$admin->row_text(T('MySQL Version'), $mysql['version']);
$admin->row_text(T('Web Server'), ($_SERVER['SERVER_SOFTWARE'] ? $_SERVER['SERVER_SOFTWARE'] : $SERVER['SERVER_SOFTWARE']));
// -------------------------------------------------------------------
$admin->row_span(T('Server Options'), 'thead');
-$mysql = $db->query_first("SHOW VARIABLES LIKE 'max_allowed_packet'");
+$mysql = $db->queryFirst("SHOW VARIABLES LIKE 'max_allowed_packet'");
$admin->row_text(T('MySQL: Maximum Packet Size'), $mysql['Value']);
-$admin->row_text(T('MySQL: Maximum Upload Size'), $funct->fetch_max_attachment_size());
+$admin->row_text(T('MySQL: Maximum Upload Size'), BSFunctions::fetch_max_php_file_size());
-$mysql = $db->query_first("SHOW VARIABLES LIKE 'ft_min_word_len'");
+$mysql = $db->queryFirst("SHOW VARIABLES LIKE 'ft_min_word_len'");
$admin->row_text(T('MySQL: Full-Text Search Minimum Word Length'), $mysql['Value']);
$admin->row_text(T('PHP: Safe Mode'), ((ini_get('safe_mode') == 1 OR strtolower(ini_get('safe_mode')) == 'on') ? T('Yes') : T('No')));
$admin->page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
require_once('./global.php');
require_once('./includes/api_language.php');
-require_once('./includes/class_api_error.php');
APIError(array(new API_Error_Handler($admin), 'admin_error'));
NavLinks::optionsPages();
if ($_REQUEST['do'] == 'kill')
{
- $language = new LanguageAPI($bugsys);
- $language->set('languageid', $bugsys->in['languageid']);
+ $language = new LanguageAPI();
+ $language->set('languageid', $input->in['languageid']);
$language->set_condition();
$language->delete();
if ($_REQUEST['do'] == 'delete')
{
- $admin->page_confirm(T('Are you sure you want to delete this language?'), 'language.php', 'kill', array('languageid' => $bugsys->input_clean('languageid', TYPE_UINT)));
+ $admin->page_confirm(T('Are you sure you want to delete this language?'), 'language.php', 'kill', array('languageid' => $input->inputClean('languageid', TYPE_UINT)));
}
// ###################################################################
if ($_POST['do'] == 'insert')
{
- $language = new LanguageAPI($bugsys);
- $language->set('title', $bugsys->in['title']);
- $language->set('charset', $bugsys->in['charset']);
- $language->set('direction', $bugsys->in['direction']);
- $language->set('userselect', $bugsys->in['userselect']);
- $language->set('langcode', $bugsys->in['langcode']);
+ $language = new LanguageAPI();
+ $language->set('title', $input->in['title']);
+ $language->set('charset', $input->in['charset']);
+ $language->set('direction', $input->in['direction']);
+ $language->set('userselect', $input->in['userselect']);
+ $language->set('langcode', $input->in['langcode']);
$language->insert();
$admin->redirect('language.php?do=modify');
if ($_POST['do'] == 'update')
{
- $language = new LanguageAPI($bugsys);
- $language->set('languageid', $bugsys->in['languageid']);
+ $language = new LanguageAPI();
+ $language->set('languageid', $input->in['languageid']);
$language->set_condition();
- $language->set('title', $bugsys->in['title']);
- $language->set('charset', $bugsys->in['charset']);
- $language->set('direction', $bugsys->in['direction']);
- $language->set('userselect', $bugsys->in['userselect']);
- $language->set('langcode', $bugsys->in['langcode']);
+ $language->set('title', $input->in['title']);
+ $language->set('charset', $input->in['charset']);
+ $language->set('direction', $input->in['direction']);
+ $language->set('userselect', $input->in['userselect']);
+ $language->set('langcode', $input->in['langcode']);
$language->update();
$admin->redirect('language.php?do=modify');
if ($_REQUEST['do'] == 'edit')
{
- NavLinks::languagesEdit($bugsys->in['languageid']);
+ NavLinks::languagesEdit($input->in['languageid']);
$navigator->set_focus('link', 'options-languages-edit', 'options-languages');
- $languageapi = new LanguageAPI($bugsys);
- $languageapi->set('languageid', $bugsys->in['languageid']);
+ $languageapi = new LanguageAPI();
+ $languageapi->set('languageid', $input->in['languageid']);
$languageapi->set_condition();
$languageapi->fetch();
- $language =& $languageapi->objdata;
+ $language =& $languageapi->record;
$admin->page_start(T('Edit Language'));
$admin->table_column_head(array(T('Title'), T('Language Code / Charset'), T('Options')));
$languages = $db->query("SELECT * FROM " . TABLE_PREFIX . "language ORDER BY languageid ASC");
- while ($language = $db->fetch_array($languages))
+ foreach ($languages as $language)
{
$admin->row_multi_item(array(
"<a href=\"language.php?do=edit&languageid=$language[languageid]\">$language[title]</a>" => 'l',
$language['langcode'] . ' / ' . $language['charset'] => 'c',
- (($bugsys->options['defaultlanguage'] == $language['languageid']) ? '<strong>' . T('DEFAULT LANGUAGE') . '</strong> / ' : '') . ($language['userselect'] ? T('User Selectable') : T('Private')) => 'c'
+ ((bugdar::$options['defaultlanguage'] == $language['languageid']) ? '<strong>' . T('DEFAULT LANGUAGE') . '</strong> / ' : '') . ($language['userselect'] ? T('User Selectable') : T('Private')) => 'c'
));
}
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
if ($_REQUEST['do'] == 'kill')
{
- $bugsys->input_clean('usergroupid', TYPE_UINT);
- $db->query("DELETE FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $bugsys->in['usergroupid'] . " AND productid = " . $bugsys->input_clean('productid', TYPE_UINT));
+ $input->inputClean('usergroupid', TYPE_UINT);
+ $db->query("DELETE FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $input->in['usergroupid'] . " AND productid = " . $input->inputClean('productid', TYPE_UINT));
build_permissions();
- $admin->redirect('permission.php?do=modify&usergroupid=' . $bugsys->in['usergroupid']);
+ $admin->redirect('permission.php?do=modify&usergroupid=' . $input->in['usergroupid']);
}
// ###################################################################
if ($_REQUEST['do'] == 'delete')
{
- $admin->page_confirm(T('Are you sure you want to revert this permission mask?'), 'permission.php', 'kill', array('usergroupid' => $bugsys->input_clean('usergroupid', TYPE_UINT), 'productid' => $bugsys->input_clean('productid', TYPE_UINT)));
+ $admin->page_confirm(T('Are you sure you want to revert this permission mask?'), 'permission.php', 'kill', array('usergroupid' => $input->inputClean('usergroupid', TYPE_UINT), 'productid' => $input->inputClean('productid', TYPE_UINT)));
}
// ###################################################################
if ($_REQUEST['do'] == 'edit')
{
- $bugsys->input_clean_array(array(
+ $input->inputClean_array(array(
'usergroupid' => TYPE_UINT,
'productid' => TYPE_UINT
));
- $perm = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $bugsys->in['usergroupid'] . " AND productid = " . $bugsys->in['productid']);
- $usergroup = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = " . $bugsys->in['usergroupid']);
- $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']);
+ $perm = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $input->in['usergroupid'] . " AND productid = " . $input->in['productid']);
+ $usergroup = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = " . $input->in['usergroupid']);
+ $product = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $input->in['productid']);
if (!$usergroup OR !$product)
{
$admin->row_span($group, 'thead', 'center');
foreach ($settings AS $setting => $name)
{
- $admin->row_yesno($name, "perm[$setting]", ($mask & $bugsys->permissions["$setting"]));
+ $admin->row_yesno($name, "perm[$setting]", ($mask & bugdar::$permissions["$setting"]));
}
}
if ($_POST['do'] == 'update')
{
- $bugsys->input_clean_array(array(
+ $input->inputClean_array(array(
'perm' => TYPE_UINT,
'usergroupid' => TYPE_UINT,
'productid' => TYPE_UINT
));
- foreach ($bugsys->in['perm'] AS $permtitle => $binaryswitch)
+ foreach ($input->in['perm'] AS $permtitle => $binaryswitch)
{
- $permissionvalue += $bugsys->permissions["$permtitle"] * $binaryswitch;
+ $permissionvalue += bugdar::$permissions["$permtitle"] * $binaryswitch;
}
$db->query("
REPLACE INTO " . TABLE_PREFIX . "permission
(usergroupid, productid, mask)
VALUES
- (" . $bugsys->in['usergroupid'] . ",
- " . $bugsys->in['productid'] . ",
+ (" . $input->in['usergroupid'] . ",
+ " . $input->in['productid'] . ",
$permissionvalue
)"
);
build_permissions();
- $admin->redirect('permission.php?do=modify&usergroupid=' . $bugsys->in['usergroupid']);
+ $admin->redirect('permission.php?do=modify&usergroupid=' . $input->in['usergroupid']);
}
// ###################################################################
$admin->table_head(T('Permission Manager'));
$groups = $db->query("SELECT * FROM " . TABLE_PREFIX . "usergroup ORDER BY usergroupid ASC");
- while ($group = $db->fetch_array($groups))
+ foreach ($groups as $group)
{
$usergroups["$group[usergroupid]"] = $group;
}
foreach ($usergroups AS $group)
{
- $admin->row_text($group['title'], ($bugsys->in['usergroupid'] != $group['usergroupid'] ? "<a href=\"permission.php?do=modify&usergroupid=$group[usergroupid]\">[" . T('Expand') . "]</a>" : ''), 'top', 2, 'alt3');
+ $admin->row_text($group['title'], ($input->in['usergroupid'] != $group['usergroupid'] ? "<a href=\"permission.php?do=modify&usergroupid=$group[usergroupid]\">[" . T('Expand') . "]</a>" : ''), 'top', 2, 'alt3');
- if ($bugsys->in['usergroupid'] == $group['usergroupid'])
+ if ($input->in['usergroupid'] == $group['usergroupid'])
{
$permissions_fetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "permission WHERE usergroupid = $group[usergroupid]");
- while ($permission = $db->fetch_array($permissions_fetch))
+ foreach ($permissions_fetch as $permission)
{
$permissions["$permission[productid]"] = $permission['mask'];
}
$products_fetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "product WHERE !parentid OR parentid IS NULL ORDER BY displayorder ASC");
- while ($product = $db->fetch_array($products_fetch))
+ foreach ($products_fetch as $product)
{
$groupid = $group['usergroupid'];
$prodid = $product['productid'];
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
require_once('./global.php');
require_once('./includes/api_priority.php');
-require_once('./includes/class_api_error.php');
APIError(array(new API_Error_Handler($admin), 'admin_error'));
NavLinks::fieldsPages();
if ($_REQUEST['do'] == 'kill')
{
- $priority = new PriorityAPI($bugsys);
- $priority->set('priorityid', $bugsys->in['priorityid']);
+ $priority = new PriorityAPI();
+ $priority->set('priorityid', $input->in['priorityid']);
$priority->set_condition();
$priority->delete();
if ($_REQUEST['do'] == 'delete')
{
- $admin->page_confirm(T('Are you sure you want to delete this priority? Doing so will revert all bugs to the default priority (which is set in the options panel)?'), 'priority.php', 'kill', array('priorityid' => $bugsys->input_clean('priorityid', TYPE_UINT)));
+ $admin->page_confirm(T('Are you sure you want to delete this priority? Doing so will revert all bugs to the default priority (which is set in the options panel)?'), 'priority.php', 'kill', array('priorityid' => $input->inputClean('priorityid', TYPE_UINT)));
}
// ###################################################################
if ($_POST['do'] == 'insert')
{
- $priority = new PriorityAPI($bugsys);
- $priority->set('priority', $bugsys->in['priority']);
- $priority->set('displayorder', $bugsys->in['displayorder']);
+ $priority = new PriorityAPI();
+ $priority->set('priority', $input->in['priority']);
+ $priority->set('displayorder', $input->in['displayorder']);
$priority->insert();
$admin->redirect('priority.php?do=modify');
if ($_POST['do'] == 'update')
{
- $priority = new PriorityAPI($bugsys);
- $priority->set('priorityid', $bugsys->in['priorityid']);
+ $priority = new PriorityAPI();
+ $priority->set('priorityid', $input->in['priorityid']);
$priority->set_condition();
- $priority->set('priority', $bugsys->in['priority']);
- $priority->set('displayorder', $bugsys->in['displayorder']);
+ $priority->set('priority', $input->in['priority']);
+ $priority->set('displayorder', $input->in['displayorder']);
$priority->update();
$admin->redirect('priority.php?do=modify');
if ($_REQUEST['do'] == 'edit')
{
- NavLinks::prioritiesEdit($bugsys->in['priorityid']);
+ NavLinks::prioritiesEdit($input->in['priorityid']);
$navigator->set_focus('link', 'fields-pages-priorities', 'fields-pages');
- $priority = new PriorityAPI($bugsys);
- $priority->set('priorityid', $bugsys->in['priorityid']);
+ $priority = new PriorityAPI();
+ $priority->set('priorityid', $input->in['priorityid']);
$priority->set_condition();
$priority->fetch();
$admin->page_start(T('Edit Priority'));
$admin->form_start('priority.php', 'update');
- $admin->form_hidden_field('priorityid', $priority->objdata['priorityid']);
+ $admin->form_hidden_field('priorityid', $priority->record['priorityid']);
$admin->table_start();
- $admin->table_head(sprintf(T('Edit Priority `%1$s` (id: %2$s)'), $priority->objdata['priority'], $priority->objdata['priorityid']));
- $admin->row_input(T('Priority Title<div><dfn>The title of this priority flag (eg: `Slated for Development` or `Address Now`)</dfn></div>'), 'priority', $priority->objdata['priority']);
- $admin->row_input(T('Display Order<div><dfn>The order in which the priorities are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder', $priority->objdata['displayorder']);
+ $admin->table_head(sprintf(T('Edit Priority `%1$s` (id: %2$s)'), $priority->record['priority'], $priority->record['priorityid']));
+ $admin->row_input(T('Priority Title<div><dfn>The title of this priority flag (eg: `Slated for Development` or `Address Now`)</dfn></div>'), 'priority', $priority->record['priority']);
+ $admin->row_input(T('Display Order<div><dfn>The order in which the priorities are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder', $priority->record['displayorder']);
$admin->row_submit();
$admin->table_end();
$admin->form_end();
$admin->table_start();
$admin->table_head(T('Priority Manager'));
- while ($priority = $db->fetch_array($priorities))
+ foreach ($priorities as $priority)
{
$admin->row_text("$priority[displayorder]: <a href=\"priority.php?do=edit&priorityid=$priority[priorityid]\">$priority[priority]</a>", "(priorityid: $priority[priorityid]) <a href=\"priority.php?do=edit&priorityid=$priority[priorityid]\">[" . T('Edit') . "]</a> <a href=\"priority.php?do=delete&priorityid=$priority[priorityid]\">[" . T('Delete') . "]</a>");
}
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
if ($_REQUEST['do'] == 'killversion')
{
- $bugsys->input_clean('versionid', TYPE_UINT);
- $db->query("DELETE FROM " . TABLE_PREFIX . "version WHERE versionid = " . $bugsys->in['versionid']);
- $db->query("DELETE FROM " . TABLE_PREFIX . "bug WHERE version = " . $bugsys->in['versionid']);
+ $input->inputClean('versionid', TYPE_UINT);
+ $db->query("DELETE FROM " . TABLE_PREFIX . "version WHERE versionid = " . $input->in['versionid']);
+ $db->query("DELETE FROM " . TABLE_PREFIX . "bug WHERE version = " . $input->in['versionid']);
build_versions();
if ($_REQUEST['do'] == 'deleteversion')
{
- $admin->page_confirm(T('Are you sure you want to delete this version? Doing so will do <strong>delete all the bugs with this version</strong>.'), 'product.php', 'killversion', array('versionid' => $bugsys->input_clean('versionid', TYPE_UINT)));
+ $admin->page_confirm(T('Are you sure you want to delete this version? Doing so will do <strong>delete all the bugs with this version</strong>.'), 'product.php', 'killversion', array('versionid' => $input->inputClean('versionid', TYPE_UINT)));
}
// ###################################################################
if ($_REQUEST['do'] == 'insertversion')
{
- $db->query("INSERT INTO " . TABLE_PREFIX . "version (productid, version, displayorder, obsolete) VALUES (" . $bugsys->input_clean('productid', TYPE_UINT) . ", '" . $bugsys->input_escape('version') . "', " . $bugsys->input_clean('displayorder', TYPE_UINT) . ", " . $bugsys->input_clean('obsolete', TYPE_UINT) . ")");
+ $db->query("INSERT INTO " . TABLE_PREFIX . "version (productid, version, displayorder, obsolete) VALUES (" . $input->inputClean('productid', TYPE_UINT) . ", '" . $bugsys->input_escape('version') . "', " . $input->inputClean('displayorder', TYPE_UINT) . ", " . $input->inputClean('obsolete', TYPE_UINT) . ")");
build_versions();
$admin->redirect('product.php?do=modify');
}
if ($_REQUEST['do'] == 'addversion')
{
- NavLinks::productsEdit($bugsys->input_clean('productid', TYPE_UINT));
+ NavLinks::productsEdit($input->inputClean('productid', TYPE_UINT));
$navigator->set_focus('link', 'products-edit-version', 'products-edit');
- if ($bugsys->in['productid'] != -1)
+ if ($input->in['productid'] != -1)
{
- $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']);
+ $product = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $input->in['productid']);
if (!is_array($product))
{
$admin->error(L_INVALID_ID);
}
else
{
- $bugsys->in['productid'] = 0;
+ $input->in['productid'] = 0;
}
$admin->page_start(T('Add Version'));
$admin->form_start('product.php', 'insertversion');
- $admin->form_hidden_field('productid', $bugsys->in['productid']);
+ $admin->form_hidden_field('productid', $input->in['productid']);
$admin->table_start();
$admin->table_head(T('Add New Version'));
$admin->row_input(T('Version Number<div><dfn>This is the version string for this product.</dfn></div>'), 'version');
if ($_REQUEST['do'] == 'updateversion')
{
- if (empty($bugsys->in['version']))
+ if (empty($input->in['version']))
{
$admin->error(T('Please fill in a version number.'));
}
- $db->query("UPDATE " . TABLE_PREFIX . "version SET version = '" . $bugsys->input_escape('version') . "', displayorder = " . $bugsys->input_clean('displayorder', TYPE_UINT) . ", obsolete = " . $bugsys->input_clean('obsolete', TYPE_UINT) . " WHERE versionid = " . $bugsys->input_clean('versionid', TYPE_UINT));
+ $db->query("UPDATE " . TABLE_PREFIX . "version SET version = '" . $bugsys->input_escape('version') . "', displayorder = " . $input->inputClean('displayorder', TYPE_UINT) . ", obsolete = " . $input->inputClean('obsolete', TYPE_UINT) . " WHERE versionid = " . $input->inputClean('versionid', TYPE_UINT));
build_versions();
$admin->redirect('product.php?do=modify');
{
$admin->page_start(T('Edit Version'));
- $version = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "version WHERE versionid = " . $bugsys->input_clean('versionid', TYPE_UINT));
+ $version = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "version WHERE versionid = " . $input->inputClean('versionid', TYPE_UINT));
if (!is_array($version))
{
$admin->error(L_INVALID_ID);
if ($_REQUEST['do'] == 'killproduct')
{
- $bugsys->input_clean('productid', TYPE_UINT);
- $allprods = $db->query("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid'] . " OR parentid = " . $bugsys->in['productid']);
- while ($prod = $db->fetch_array($allprods))
+ $input->inputClean('productid', TYPE_UINT);
+ $allprods = $db->query("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $input->in['productid'] . " OR parentid = " . $input->in['productid']);
+ foreach ($allprods as $prod)
{
$list[] = $prod['productid'];
}
if ($_REQUEST['do'] == 'deleteproduct')
{
- $admin->page_confirm(T('Are you sure you want to delete this product and all of it\'s versions and components <strong>and any bugs that have been assigned those products or components</strong>?'), 'product.php', 'killproduct', array('productid' => $bugsys->input_clean('productid', TYPE_UINT)));
+ $admin->page_confirm(T('Are you sure you want to delete this product and all of it\'s versions and components <strong>and any bugs that have been assigned those products or components</strong>?'), 'product.php', 'killproduct', array('productid' => $input->inputClean('productid', TYPE_UINT)));
}
// ###################################################################
if ($_REQUEST['do'] == 'insertproduct')
{
- if (empty($bugsys->in['title']))
+ if (empty($input->in['title']))
{
$admin->error(T('Please go back and fill in the title field.'));
}
INSERT INTO " . TABLE_PREFIX . "product
(title, parentid, description, displayorder)
VALUES
- ('" . $bugsys->input_escape('title') . "', " . $bugsys->input_clean('parentid', TYPE_UINT) . ",
- '" . $bugsys->input_escape('description') . "', " . $bugsys->input_clean('displayorder', TYPE_UINT) . "
+ ('" . $bugsys->input_escape('title') . "', " . $input->inputClean('parentid', TYPE_UINT) . ",
+ '" . $bugsys->input_escape('description') . "', " . $input->inputClean('displayorder', TYPE_UINT) . "
)"
);
build_products();
if ($_REQUEST['do'] == 'addproduct')
{
- if ($bugsys->input_clean('productid', TYPE_UINT))
+ if ($input->inputClean('productid', TYPE_UINT))
{
- NavLinks::productsEdit($bugsys->in['productid']);
+ NavLinks::productsEdit($input->in['productid']);
}
else
{
$admin->page_start(T('Add New Product'));
$admin->form_start('product.php', 'insertproduct');
- $admin->form_hidden_field('parentid', $bugsys->in['productid']);
+ $admin->form_hidden_field('parentid', $input->in['productid']);
$admin->table_start();
$admin->table_head(T('Add Product'));
$admin->row_input(T('Title'), 'title');
if ($_REQUEST['do'] == 'updateproduct')
{
- if (empty($bugsys->in['title']))
+ if (empty($input->in['title']))
{
$admin->error(T('Please go back and fill in the title field.'));
}
- if (empty($bugsys->in['productid']))
+ if (empty($input->in['productid']))
{
$admin->error(L_INVALID_ID);
}
- $db->query("UPDATE " . TABLE_PREFIX . "product SET title = '" . $bugsys->input_escape('title') . "', description = '" . $bugsys->input_escape('description') . "', displayorder = " . $bugsys->input_clean('displayorder', TYPE_UINT) . " WHERE productid = " . $bugsys->input_clean('productid', TYPE_UINT));
+ $db->query("UPDATE " . TABLE_PREFIX . "product SET title = '" . $bugsys->input_escape('title') . "', description = '" . $bugsys->input_escape('description') . "', displayorder = " . $input->inputClean('displayorder', TYPE_UINT) . " WHERE productid = " . $input->inputClean('productid', TYPE_UINT));
build_products();
$admin->redirect('product.php?do=modify');
if ($_REQUEST['do'] == 'editproduct')
{
- NavLinks::productsEdit($bugsys->input_clean('productid', TYPE_UINT));
+ NavLinks::productsEdit($input->inputClean('productid', TYPE_UINT));
$navigator->set_focus('link', 'products-edit', 'products-edit');
$admin->page_start(T('Edit Product'));
- $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']);
+ $product = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $input->in['productid']);
if (!is_array($product))
{
$admin->error(L_INVALID_ID);
if ($_POST['do'] == 'displayorder')
{
- $bugsys->input_clean('displayorder', TYPE_UINT);
- if (is_array($bugsys->in['displayorder']))
+ $input->inputClean('displayorder', TYPE_UINT);
+ if (is_array($input->in['displayorder']))
{
- foreach ($bugsys->in['displayorder'] AS $namebit => $displayorder)
+ foreach ($input->in['displayorder'] AS $namebit => $displayorder)
{
$name = explode('_', $namebit);
if ($name[0] == 'product' OR $name[0] == 'version')
$products_get = $db->query("SELECT * FROM " . TABLE_PREFIX . "product ORDER BY displayorder ASC");
$products = array();
- while ($prod = $db->fetch_array($products_get))
+ foreach ($products_get as $prod)
{
if (!$prod['parentid'])
{
$versions_get = $db->query("SELECT * FROM " . TABLE_PREFIX . "version ORDER BY displayorder ASC");
$versions = array();
- while ($vers = $db->fetch_array($versions_get))
+ foreach ($versions_get as $vers)
{
$versions["$vers[productid]"]["$vers[versionid]"] = $vers;
}
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
require_once('./global.php');
require_once('./includes/api_resolution.php');
-require_once('./includes/class_api_error.php');
APIError(array(new API_Error_Handler($admin), 'admin_error'));
NavLinks::fieldsPages();
if ($_REQUEST['do'] == 'kill')
{
- $resolution = new ResolutionAPI($bugsys);
- $resolution->set('resolutionid', $bugsys->in['resolutionid']);
+ $resolution = new ResolutionAPI();
+ $resolution->set('resolutionid', $input->in['resolutionid']);
$resolution->set_condition();
$resolution->delete();
if ($_REQUEST['do'] == 'delete')
{
- $admin->page_confirm(T('Are you sure you want to delete this resolution? Doing so will revert all bugs to the default resolution (which is set in the options panel)?'), 'resolution.php', 'kill', array('resolutionid' => $bugsys->input_clean('resolutionid', TYPE_UINT)));
+ $admin->page_confirm(T('Are you sure you want to delete this resolution? Doing so will revert all bugs to the default resolution (which is set in the options panel)?'), 'resolution.php', 'kill', array('resolutionid' => $input->inputClean('resolutionid', TYPE_UINT)));
}
// ###################################################################
if ($_POST['do'] == 'insert')
{
- $resolution = new ResolutionAPI($bugsys);
- $resolution->set('resolution', $bugsys->in['resolution']);
- $resolution->set('displayorder', $bugsys->in['displayorder']);
+ $resolution = new ResolutionAPI();
+ $resolution->set('resolution', $input->in['resolution']);
+ $resolution->set('displayorder', $input->in['displayorder']);
$resolution->insert();
$admin->redirect('resolution.php?do=modify');
if ($_POST['do'] == 'update')
{
- $resolution = new ResolutionAPI($bugsys);
- $resolution->set('resolutionid', $bugsys->in['resolutionid']);
+ $resolution = new ResolutionAPI();
+ $resolution->set('resolutionid', $input->in['resolutionid']);
$resolution->set_condition();
- $resolution->set('resolution', $bugsys->in['resolution']);
- $resolution->set('displayorder', $bugsys->in['displayorder']);
+ $resolution->set('resolution', $input->in['resolution']);
+ $resolution->set('displayorder', $input->in['displayorder']);
$resolution->update();
$admin->redirect('resolution.php?do=modify');
if ($_REQUEST['do'] == 'edit')
{
- NavLinks::resolutionsEdit($bugsys->in['resolutionid']);
+ NavLinks::resolutionsEdit($input->in['resolutionid']);
$navigator->set_focus('link', 'fields-pages-resolutions', 'fields-pages');
- $resolution = new ResolutionAPI($bugsys);
- $resolution->set('resolutionid', $bugsys->in['resolutionid']);
+ $resolution = new ResolutionAPI();
+ $resolution->set('resolutionid', $input->in['resolutionid']);
$resolution->set_condition();
$resolution->fetch();
$admin->page_start(T('Edit Resolution'));
$admin->form_start('resolution.php', 'update');
- $admin->form_hidden_field('resolutionid', $resolution->objdata['resolutionid']);
+ $admin->form_hidden_field('resolutionid', $resolution->record['resolutionid']);
$admin->table_start();
- $admin->table_head(sprintf(T('Edit Resolution - %1$s (id: %2$s)'), $resolution->objdata['resolution'], $resolution->objdata['resolutionid']));
- $admin->row_input(T('Resolution Title<div><dfn>The title of this resolution flag (eg: `Fixed` or `Bogus`)</dfn></div>'), 'resolution', $resolution->objdata['resolution']);
- $admin->row_input(T('Display Order<div><dfn>The order in which the resolutions are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder', $resolution->objdata['displayorder']);
+ $admin->table_head(sprintf(T('Edit Resolution - %1$s (id: %2$s)'), $resolution->record['resolution'], $resolution->record['resolutionid']));
+ $admin->row_input(T('Resolution Title<div><dfn>The title of this resolution flag (eg: `Fixed` or `Bogus`)</dfn></div>'), 'resolution', $resolution->record['resolution']);
+ $admin->row_input(T('Display Order<div><dfn>The order in which the resolutions are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder', $resolution->record['displayorder']);
$admin->row_submit();
$admin->table_end();
$admin->form_end();
$admin->table_start();
$admin->table_head(T('Resolution Manager'));
- while ($resolution = $db->fetch_array($resolutions))
+ foreach ($resolutions as $resolution)
{
$admin->row_text("$resolution[displayorder]: <a href=\"resolution.php?do=edit&resolutionid=$resolution[resolutionid]\">$resolution[resolution]</a>", "(resolutionid: $resolution[resolutionid]) <a href=\"resolution.php?do=edit&resolutionid=$resolution[resolutionid]\">[" . T('Edit') . "]</a> <a href=\"resolution.php?do=delete&resolutionid=$resolution[resolutionid]\">[" . T('Delete') . "]</a>");
}
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
if ($_POST['do'] == 'update')
{
$updates = array();
- foreach ($bugsys->in['setting'] AS $varname => $value)
+ foreach ($input->in['setting'] AS $varname => $value)
{
if (is_array($value))
{
// authmethod
$admin->row_span(T('Authentication Method'), 'thead');
- $methods = $funct->scandir('./includes/auth/');
+ $methods = BSFunctions::scan_directory('./includes/auth/');
foreach ($methods[''] AS $path)
{
if (preg_match('#auth_(.*)\.php#', $path, $matches))
{
- $admin->list_item(ucwords(str_replace('_', ' ', $matches[1])), $matches[1], ($matches[1] == $bugsys->options['authmethod']));
+ $admin->list_item(ucwords(str_replace('_', ' ', $matches[1])), $matches[1], ($matches[1] == bugdar::$options['authmethod']));
}
}
$admin->row_list(T('The authentication class to use to validate cookie data and longins. You may need to edit the actual file for certain authentication systems.'), 'setting[authmethod]');
// allownewreg
$admin->row_span(T('Allow New Registrations'), 'thead');
- $admin->row_yesno(T('If this is set to <em>yes</em>, then new users will be allowed to register.'), 'setting[allownewreg]', $bugsys->options['allownewreg']);
+ $admin->row_yesno(T('If this is set to <em>yes</em>, then new users will be allowed to register.'), 'setting[allownewreg]', bugdar::$options['allownewreg']);
// verifyemail
$admin->row_span(T('Require Activation Email'), 'thead');
- $admin->row_yesno(T('Setting this to yes will force all new users to verify their account with an email activation link.'), 'setting[verifyemail]', $bugsys->options['verifyemail']);
+ $admin->row_yesno(T('Setting this to yes will force all new users to verify their account with an email activation link.'), 'setting[verifyemail]', bugdar::$options['verifyemail']);
// moderatenewusers
$admin->row_span(T('Moderate New Users'), 'thead');
- $admin->row_yesno(T('All new users will have to be approved by the administration before being able to have normal user rights.'), 'setting[moderatenewusers]', $bugsys->options['moderatenewusers']);
+ $admin->row_yesno(T('All new users will have to be approved by the administration before being able to have normal user rights.'), 'setting[moderatenewusers]', bugdar::$options['moderatenewusers']);
// sendwelcomemail
$admin->row_span(T('Send New Use Welcome Email'), 'thead');
- $admin->row_yesno(T('Setting this option to <em>yes</em> will send each new verified user a welcome email.'), 'setting[sendwelcomemail]', $bugsys->options['sendwelcomemail']);
+ $admin->row_yesno(T('Setting this option to <em>yes</em> will send each new verified user a welcome email.'), 'setting[sendwelcomemail]', bugdar::$options['sendwelcomemail']);
// webmasteremail
$admin->row_span(T('Webmaster Email Address'), 'thead');
- $admin->row_input(T('The email address from which emails will be sent out.'), 'setting[webmasteremail]', $bugsys->options['webmasteremail']);
+ $admin->row_input(T('The email address from which emails will be sent out.'), 'setting[webmasteremail]', bugdar::$options['webmasteremail']);
// trackertitle
$admin->row_span(T('Tracker Title'), 'thead');
- $admin->row_input(T('The global name of the bug tracker. Example: Blue Static Bug Tracker'), 'setting[trackertitle]', $bugsys->options['trackertitle']);
+ $admin->row_input(T('The global name of the bug tracker. Example: Blue Static Bug Tracker'), 'setting[trackertitle]', bugdar::$options['trackertitle']);
// trackerurl
$admin->row_span(T('Tracker Base URL'), 'thead');
- $admin->row_input(T('The base URL of the tracker. This is used when creating external links to the tracker. <strong>Be sure that this does not end in a trailing slash ("/").</strong><br />Example: http://www.bluestatic.org/bugs'), 'setting[trackerurl]', $bugsys->options['trackerurl']);
+ $admin->row_input(T('The base URL of the tracker. This is used when creating external links to the tracker. <strong>Be sure that this does not end in a trailing slash ("/").</strong><br />Example: http://www.bluestatic.org/bugs'), 'setting[trackerurl]', bugdar::$options['trackerurl']);
// dateformat
$admin->row_span(T('Date Format'), 'thead');
- $admin->row_input(T('Set the date format used for bug report and comment information. This is based on PHP\'s date() function.'), 'setting[dateformat]', $bugsys->options['dateformat']);
+ $admin->row_input(T('Set the date format used for bug report and comment information. This is based on PHP\'s date() function.'), 'setting[dateformat]', bugdar::$options['dateformat']);
// defaulttimezone
$admin->row_span(T('Default Time Zone'), 'thead');
- $admin->row_text(T('This controls the time zone that all unregistered users view the tracker with.'), construct_option_select('setting[defaulttimezone]', $bugsys->datef->fetch_timezone_list(), $bugsys->options['defaulttimezone']), $bugsys->options['defaulttimezone']);
+ $admin->row_text(T('This controls the time zone that all unregistered users view the tracker with.'), construct_option_select('setting[defaulttimezone]', $bugsys->datef->fetch_timezone_list(), bugdar::$options['defaulttimezone']), bugdar::$options['defaulttimezone']);
// defaultlanguage
$admin->row_span(T('Default Language'), 'thead');
- $admin->row_text(T('You can set the default language that all new users (and guests) will use.'), construct_option_select('setting[defaultlanguage]', $bugsys->datastore['language'], $bugsys->options['defaultlanguage'], 'languageid', 'title'), $bugsys->options['defaultlanguage']);
+ $admin->row_text(T('You can set the default language that all new users (and guests) will use.'), construct_option_select('setting[defaultlanguage]', bugdar::$datastore['language'], bugdar::$options['defaultlanguage'], 'languageid', 'title'), bugdar::$options['defaultlanguage']);
// syndicateditems
$admin->row_span(T('Number of Syndicated Items'), 'thead');
- $admin->row_input(T('The number of bugs to be syndicated at any one time by the Atom XML feed.'), 'setting[syndicateditems]', $bugsys->options['syndicateditems']);
+ $admin->row_input(T('The number of bugs to be syndicated at any one time by the Atom XML feed.'), 'setting[syndicateditems]', bugdar::$options['syndicateditems']);
// redirectheaders
$admin->row_span(T('Use Header Redirects'), 'thead');
- $admin->row_yesno(T('Instead of displaying an intermediate page informing the user that their action was a success and a redirect is occurring, just send the user to the next screen using HTTP headers. This can save bandwidth.'), 'setting[redirectheaders]', $bugsys->options['redirectheaders']);
+ $admin->row_yesno(T('Instead of displaying an intermediate page informing the user that their action was a success and a redirect is occurring, just send the user to the next screen using HTTP headers. This can save bandwidth.'), 'setting[redirectheaders]', bugdar::$options['redirectheaders']);
$admin->table_end();
// allowhtml
$admin->row_span(T('Allow HTML in Bug Reports'), 'thead');
- $admin->row_yesno(T('Set this to <em>yes</em> if you want to allow users to post raw HTML in their bug reports. This is <strong>very</strong> dangerous and it is not recommended.'), 'setting[allowhtml]', $bugsys->options['allowhtml']);
+ $admin->row_yesno(T('Set this to <em>yes</em> if you want to allow users to post raw HTML in their bug reports. This is <strong>very</strong> dangerous and it is not recommended.'), 'setting[allowhtml]', bugdar::$options['allowhtml']);
// defaultseverity
$admin->row_span(T('Default Severity'), 'thead');
- $admin->row_text(T('The default severity that is selected when creating a new bug report.'), construct_option_select('setting[defaultseverity]', $bugsys->datastore['severity'], $bugsys->options['defaultseverity'], 'severityid', 'severity'));
+ $admin->row_text(T('The default severity that is selected when creating a new bug report.'), construct_option_select('setting[defaultseverity]', bugdar::$datastore['severity'], bugdar::$options['defaultseverity'], 'severityid', 'severity'));
// defaultpriority
$admin->row_span(T('Default Priority'), 'thead');
- $admin->row_text(T('The default priority that will be selected when creating a new bug report. Depending on your permission setup, the user may not be able to set this in a new report so this will act as the value.'), construct_option_select('setting[defaultpriority]', $bugsys->datastore['priority'], $bugsys->options['defaultpriority'], 'priorityid', 'priority'));
+ $admin->row_text(T('The default priority that will be selected when creating a new bug report. Depending on your permission setup, the user may not be able to set this in a new report so this will act as the value.'), construct_option_select('setting[defaultpriority]', bugdar::$datastore['priority'], bugdar::$options['defaultpriority'], 'priorityid', 'priority'));
// defaultstatus
$admin->row_span(T('Default Status'), 'thead');
- $admin->row_text(T('The default default that is selected when creating a new bug report. If a user can not assign a status, this will be the one inserted into the database.'), construct_option_select('setting[defaultstatus]', $bugsys->datastore['status'], $bugsys->options['defaultstatus'], 'statusid', 'status'));
+ $admin->row_text(T('The default default that is selected when creating a new bug report. If a user can not assign a status, this will be the one inserted into the database.'), construct_option_select('setting[defaultstatus]', bugdar::$datastore['status'], bugdar::$options['defaultstatus'], 'statusid', 'status'));
// defaultresolve
$admin->row_span(T('Default Resolution'), 'thead');
- $admin->row_text(T('This is the default bug resolution. If a user is not able to change this field, setting this will act as the default value.'), construct_option_select('setting[defaultresolve]', $bugsys->datastore['resolution'], $bugsys->options['defaultresolve'], 'resolutionid', 'resolution'));
+ $admin->row_text(T('This is the default bug resolution. If a user is not able to change this field, setting this will act as the default value.'), construct_option_select('setting[defaultresolve]', bugdar::$datastore['resolution'], bugdar::$options['defaultresolve'], 'resolutionid', 'resolution'));
// defaultassign
$admin->row_span(T('Default Bug Assignment'), 'thead');
- $admin->row_text(T('This is the default developer new bugs will be assigned to. If a user does not have permisssion to assign bugs, this will be the default. If you don\'t want any default assignment, leave this as <em>Not Selected</em>.'), construct_option_select('setting[defaultassign]', $bugsys->datastore['assignto'], $bugsys->options['defaultassign'], 'userid', 'displayname', 0));
+ $admin->row_text(T('This is the default developer new bugs will be assigned to. If a user does not have permisssion to assign bugs, this will be the default. If you don\'t want any default assignment, leave this as <em>Not Selected</em>.'), construct_option_select('setting[defaultassign]', bugdar::$datastore['assignto'], bugdar::$options['defaultassign'], 'userid', 'displayname', 0));
// defaultcomment
$admin->row_span(T('Default Comment Text'), 'thead');
- $admin->row_textarea(T('If you wish to set a template for entering the initial comment of a bug report, then you may specify this here. However, the template will only take effect on the initial report/comment. Note: the template cannot be forced on the user as there is no way to validate it.'), 'setting[defaultcomment]', $bugsys->options['defaultcomment']);
+ $admin->row_textarea(T('If you wish to set a template for entering the initial comment of a bug report, then you may specify this here. However, the template will only take effect on the initial report/comment. Note: the template cannot be forced on the user as there is no way to validate it.'), 'setting[defaultcomment]', bugdar::$options['defaultcomment']);
$admin->table_end();
// hidestatuses
$admin->row_span(T('Hide Statuses on Bug Listings'), 'thead');
- $admin->row_text(T('Here you can specify which statuses to hide on the bug list displays. Users have options in their controls to change this from these values, and this does not affect searches or the favorites list.'), construct_option_select('setting[hidestatuses]', $bugsys->datastore['status'], $bugsys->options['hidestatuses'], 'statusid', 'status', 0, true));
+ $admin->row_text(T('Here you can specify which statuses to hide on the bug list displays. Users have options in their controls to change this from these values, and this does not affect searches or the favorites list.'), construct_option_select('setting[hidestatuses]', bugdar::$datastore['status'], bugdar::$options['hidestatuses'], 'statusid', 'status', 0, true));
// defaultsortkey
$admin->row_span(T('Default Sort Column'), 'thead');
- $admin->row_text(T('Select the column to sort bugs by on listings. This is only a default setting which users can override in their preferences.'), construct_option_select('setting[defaultsortkey]', ListSorter::fetch_by_text(false, false), $bugsys->options['defaultsortkey']));
+ $admin->row_text(T('Select the column to sort bugs by on listings. This is only a default setting which users can override in their preferences.'), construct_option_select('setting[defaultsortkey]', ListSorter::fetch_by_text(false, false), bugdar::$options['defaultsortkey']));
// defaultsortas
$admin->row_span(T('Default Sort Direction'), 'thead');
- $admin->row_text(T('Specify the default direction to sort bugs in the selected column. This works with and follows the same rules as the Sort Column.'), construct_option_select('setting[defaultsortas]', ListSorter::fetch_as_text(false), $bugsys->options['defaultsortas']));
+ $admin->row_text(T('Specify the default direction to sort bugs in the selected column. This works with and follows the same rules as the Sort Column.'), construct_option_select('setting[defaultsortas]', ListSorter::fetch_as_text(false), bugdar::$options['defaultsortas']));
// columnoptions
$admin->row_span(T('Default Column Ordering Options'), 'thead');
// defaultpp
$admin->row_span(T('Default Per-Page Amount'), 'thead');
- $admin->row_input(T('The number of items (e.g. bugs) to be displayed on a page by default. The user will have the option of over-riding these values.'), 'setting[defaultpp]', $bugsys->options['defaultpp']);
+ $admin->row_input(T('The number of items (e.g. bugs) to be displayed on a page by default. The user will have the option of over-riding these values.'), 'setting[defaultpp]', bugdar::$options['defaultpp']);
// maxpp
$admin->row_span(T('Maximum Per-Page Value'), 'thead');
- $admin->row_input(T('To prevent your server from experiencing load problems, set the maximum per page limit. Specifying a value here will make sure any user-entered value will not be higher than this, preventing server load problems.'), 'setting[maxpp]', $bugsys->options['maxpp']);
+ $admin->row_input(T('To prevent your server from experiencing load problems, set the maximum per page limit. Specifying a value here will make sure any user-entered value will not be higher than this, preventing server load problems.'), 'setting[maxpp]', bugdar::$options['maxpp']);
// pagelinks
$admin->row_span(T('Number of Page Links'), 'thead');
- $admin->row_input(T('The number of pages that will appear in the page navigation system on either side of the current page. Set this to 0 to display all pages.'), 'setting[pagelinks]', $bugsys->options['pagelinks']);
+ $admin->row_input(T('The number of pages that will appear in the page navigation system on either side of the current page. Set this to 0 to display all pages.'), 'setting[pagelinks]', bugdar::$options['pagelinks']);
$admin->table_end();
// trackerversion
$admin->row_span('Version Number', 'thead');
- $admin->row_input('Version Number', 'setting[trackerversion]', $bugsys->options['trackerversion']);
+ $admin->row_input('Version Number', 'setting[trackerversion]', bugdar::$options['trackerversion']);
$admin->row_span('Custom Gettext Localizer', 'thead');
- $admin->row_yesno('Use the custom MOReader implementation rather than the built-in Gettext extension.', 'setting[devgettext]', $bugsys->options['devgettext']);
+ $admin->row_yesno('Use the custom MOReader implementation rather than the built-in Gettext extension.', 'setting[devgettext]', bugdar::$options['devgettext']);
}
// ###################################################################
// ###################################################################
/**
-* Helper function for the $bugsys->options['columnoptions'] setting
+* Helper function for the bugdar::$options['columnoptions'] setting
*
* @return string Setting HTML code
*/
require_once('./includes/class_sort.php');
- $array = ($bugsys->options['columnoptions'] == null ? array('bugid' => 1, 'summary' => 2, 'userid' => 2, 'product' => 3, 'version' => 3, 'component' => 0, 'status' => 4, 'resolution' => 4, 'priority' => 5, 'severity' => 5, 'lastpost' => 6, 'votes' => 0) : $bugsys->options['columnoptions']);
+ $array = (bugdar::$options['columnoptions'] == null ? array('bugid' => 1, 'summary' => 2, 'userid' => 2, 'product' => 3, 'version' => 3, 'component' => 0, 'status' => 4, 'resolution' => 4, 'priority' => 5, 'severity' => 5, 'lastpost' => 6, 'votes' => 0) : bugdar::$options['columnoptions']);
$return = '<table cellspacing="2" cellpadding="1" border="0">';
foreach (ListSorter::fetch_by_text(false, false) AS $column => $name)
return $return;
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
require_once('./global.php');
require_once('./includes/api_severity.php');
-require_once('./includes/class_api_error.php');
APIError(array(new API_Error_Handler($admin), 'admin_error'));
NavLinks::fieldsPages();
if ($_REQUEST['do'] == 'kill')
{
- $severity = new SeverityAPI($bugsys);
- $severity->set('severityid', $bugsys->in['severityid']);
+ $severity = new SeverityAPI();
+ $severity->set('severityid', $input->in['severityid']);
$severity->set_condition();
$severity->delete();
if ($_REQUEST['do'] == 'delete')
{
- $admin->page_confirm(T('Are you sure you want to delete this severity? Doing so will revert all bugs to the default severity (which is set in the options panel)?'), 'severity.php', 'kill', array('severityid' => $bugsys->input_clean('severityid', TYPE_UINT)));
+ $admin->page_confirm(T('Are you sure you want to delete this severity? Doing so will revert all bugs to the default severity (which is set in the options panel)?'), 'severity.php', 'kill', array('severityid' => $input->inputClean('severityid', TYPE_UINT)));
}
// ###################################################################
if ($_POST['do'] == 'insert')
{
- $severity = new SeverityAPI($bugsys);
- $severity->set('severity', $bugsys->in['severity']);
- $severity->set('displayorder', $bugsys->in['displayorder']);
+ $severity = new SeverityAPI();
+ $severity->set('severity', $input->in['severity']);
+ $severity->set('displayorder', $input->in['displayorder']);
$severity->insert();
$admin->redirect('severity.php?do=modify');
if ($_POST['do'] == 'update')
{
- $severity = new SeverityAPI($bugsys);
- $severity->set('severityid', $bugsys->in['severityid']);
+ $severity = new SeverityAPI();
+ $severity->set('severityid', $input->in['severityid']);
$severity->set_condition();
- $severity->set('severity', $bugsys->in['severity']);
- $severity->set('displayorder', $bugsys->in['displayorder']);
+ $severity->set('severity', $input->in['severity']);
+ $severity->set('displayorder', $input->in['displayorder']);
$severity->update();
$admin->redirect('severity.php?do=modify');
if ($_REQUEST['do'] == 'edit')
{
- NavLinks::severitiesEdit($bugsys->in['severityid']);
+ NavLinks::severitiesEdit($input->in['severityid']);
$navigator->set_focus('link', 'fields-pages-severities', 'fields-pages');
- $severity = new SeverityAPI($bugsys);
- $severity->set('severityid', $bugsys->in['severityid']);
+ $severity = new SeverityAPI();
+ $severity->set('severityid', $input->in['severityid']);
$severity->set_condition();
$severity->fetch();
$admin->page_start(T('Edit Severity'));
$admin->form_start('severity.php', 'update');
- $admin->form_hidden_field('severityid', $severity->objdata['severityid']);
+ $admin->form_hidden_field('severityid', $severity->record['severityid']);
$admin->table_start();
- $admin->table_head(sprintf(T('Edit Severity - %1$s (id: %2$s)'), $severity->objdata['severity'], $severity->objdata['severityid']));
- $admin->row_input(T('Severity Title<div><dfn>The title of this severity flag (eg: `Major` or `Critical`)</dfn></div>'), 'severity', $severity->objdata['severity']);
- $admin->row_input(T('Display Order<div><dfn>The order in which the severities are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder', $severity->objdata['displayorder']);
+ $admin->table_head(sprintf(T('Edit Severity - %1$s (id: %2$s)'), $severity->record['severity'], $severity->record['severityid']));
+ $admin->row_input(T('Severity Title<div><dfn>The title of this severity flag (eg: `Major` or `Critical`)</dfn></div>'), 'severity', $severity->record['severity']);
+ $admin->row_input(T('Display Order<div><dfn>The order in which the severities are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder', $severity->record['displayorder']);
$admin->row_submit();
$admin->table_end();
$admin->form_end();
$admin->table_start();
$admin->table_head(T('Severity Manager'));
- while ($severity = $db->fetch_array($severities))
+ foreach ($severities as $severity)
{
$admin->row_text("$severity[displayorder]: <a href=\"severity.php?do=edit&severityid=$severity[severityid]\">$severity[severity]</a>", "(severityid: $severity[severityid]) <a href=\"severity.php?do=edit&severityid=$severity[severityid]\">[" . T('Edit') . "]</a> <a href=\"severity.php?do=delete&severityid=$severity[severityid]\">[" . T('Delete') . "]</a>");
}
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
require_once('./global.php');
require_once('./includes/api_status.php');
-require_once('./includes/class_api_error.php');
APIError(array(new API_Error_Handler($admin), 'admin_error'));
NavLinks::fieldsPages();
if ($_REQUEST['do'] == 'kill')
{
- $status = new StatusAPI($bugsys);
- $status->set('statusid', $bugsys->in['statusid']);
+ $status = new StatusAPI();
+ $status->set('statusid', $input->in['statusid']);
$status->set_condition();
$status->delete();
if ($_REQUEST['do'] == 'delete')
{
- $admin->page_confirm(T('Are you sure you want to delete this status? Doing so will revert all bugs to the default status (which is set in the options panel)?'), 'status.php', 'kill', array('statusid' => $bugsys->input_clean('statusid', TYPE_UINT)));
+ $admin->page_confirm(T('Are you sure you want to delete this status? Doing so will revert all bugs to the default status (which is set in the options panel)?'), 'status.php', 'kill', array('statusid' => $input->inputClean('statusid', TYPE_UINT)));
}
// ###################################################################
if ($_POST['do'] == 'insert')
{
- $status = new StatusAPI($bugsys);
- $status->set('status', $bugsys->in['status']);
- $status->set('color', $bugsys->in['color']);
- $status->set('displayorder', $bugsys->in['displayorder']);
+ $status = new StatusAPI();
+ $status->set('status', $input->in['status']);
+ $status->set('color', $input->in['color']);
+ $status->set('displayorder', $input->in['displayorder']);
$status->insert();
$admin->redirect('status.php?do=modify');
if ($_POST['do'] == 'update')
{
- $status = new StatusAPI($bugsys);
- $status->set('statusid', $bugsys->in['statusid']);
+ $status = new StatusAPI();
+ $status->set('statusid', $input->in['statusid']);
$status->set_condition();
- $status->set('status', $bugsys->in['status']);
- $status->set('color', $bugsys->in['color']);
- $status->set('displayorder', $bugsys->in['displayorder']);
+ $status->set('status', $input->in['status']);
+ $status->set('color', $input->in['color']);
+ $status->set('displayorder', $input->in['displayorder']);
$status->update();
$admin->redirect('status.php?do=modify');
if ($_REQUEST['do'] == 'edit')
{
- NavLinks::statusesEdit($bugsys->in['statusid']);
+ NavLinks::statusesEdit($input->in['statusid']);
$navigator->set_focus('link', 'fields-pages-statuses', 'fields-pages');
- $status = new StatusAPI($bugsys);
- $status->set('statusid', $bugsys->in['statusid']);
+ $status = new StatusAPI();
+ $status->set('statusid', $input->in['statusid']);
$status->set_condition();
$status->fetch();
$admin->page_start(T('Edit Status'));
$admin->form_start('status.php', 'update');
- $admin->form_hidden_field('statusid', $status->objdata['statusid']);
+ $admin->form_hidden_field('statusid', $status->record['statusid']);
$admin->table_start();
- $admin->table_head(sprintf(T('Edit Status - %1$s (id: %2$s)'), $status->objdata['status'], $status->objdata['statusid']));
- $admin->row_input(T('Status Title<div><dfn>The title of this status flag (eg: `Confirmed` or `Closed (Fixed)`)</dfn></div>'), 'status', $status->objdata['status']);
- $admin->row_input(T('Display Order<div><dfn>The order in which the statuses ar displayed.</dfn></div>'), 'displayorder', $status->objdata['displayorder']);
- $admin->row_input(T('Status Color<div><dfn>The color of the status. This will be displayed on bug listings page to make viewing easier. Note: you must enter the # sign if you are using HEX values.</dfn></div>'), 'color', $status->objdata['color']);
+ $admin->table_head(sprintf(T('Edit Status - %1$s (id: %2$s)'), $status->record['status'], $status->record['statusid']));
+ $admin->row_input(T('Status Title<div><dfn>The title of this status flag (eg: `Confirmed` or `Closed (Fixed)`)</dfn></div>'), 'status', $status->record['status']);
+ $admin->row_input(T('Display Order<div><dfn>The order in which the statuses ar displayed.</dfn></div>'), 'displayorder', $status->record['displayorder']);
+ $admin->row_input(T('Status Color<div><dfn>The color of the status. This will be displayed on bug listings page to make viewing easier. Note: you must enter the # sign if you are using HEX values.</dfn></div>'), 'color', $status->record['color']);
$admin->row_submit();
$admin->table_end();
$admin->form_end();
$admin->table_start();
$admin->table_head(T('Status Manager'));
- while ($status = $db->fetch_array($statuses))
+ foreach ($statuses as $status)
{
$colorblock = '<span style="float: right"><div style="height: 12px; width: 12px; background-color: ' . $status['color'] . '; border: 1px black solid"></div></span>';
$admin->row_text("$colorblock$status[displayorder]: <a href=\"status.php?do=edit&statusid=$status[statusid]\">$status[status]</a>", "(statusid: $status[statusid]) <a href=\"status.php?do=edit&statusid=$status[statusid]\">[" . T('Edit') . "]</a> <a href=\"status.php?do=delete&statusid=$status[statusid]\">[" . T('Delete') . "]</a>");
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
require_once('./includes/api_user.php');
require_once('./includes/class_sort.php');
-require_once('./includes/class_api_error.php');
APIError(array(new API_Error_Handler($admin), 'admin_error'));
NavLinks::usersPages();
if ($_REQUEST['do'] == 'kill')
{
- $user = new UserAPI($bugsys);
- $user->set('userid', $bugsys->in['userid']);
+ $user = new UserAPI();
+ $user->set('userid', $input->in['userid']);
$user->set_condition();
$user->delete();
if ($_REQUEST['do'] == 'delete')
{
- $admin->page_confirm(T('Are you sure you want to delete this user?'), 'user.php', 'kill', array('userid' => $bugsys->input_clean('userid', TYPE_UINT)));
+ $admin->page_confirm(T('Are you sure you want to delete this user?'), 'user.php', 'kill', array('userid' => $input->inputClean('userid', TYPE_UINT)));
}
// ###################################################################
if ($_POST['do'] == 'insert')
{
- $user = new UserAPI($bugsys);
- $user->set('displayname', $bugsys->in['displayname']);
- $user->set('email', $bugsys->in['email']);
- $user->set('showemail', $bugsys->in['showemail']);
- $user->set('showcolors', $bugsys->in['showcolors']);
- $user->set('usergroupid', $bugsys->in['usergroupid']);
- $user->set('groupids', $bugsys->in['groupids']);
- $user->set('languageid', $bugsys->in['languageid']);
- $user->set('timezone', $bugsys->in['timezone']);
- $user->set('usedst', $bugsys->in['usedst']);
- $user->set('password', $bugsys->in['password']);
- $user->set('hidestatuses', $bugsys->in['hidestatuses']);
- $user->set('defaultsortkey', $bugsys->in['defaultsortkey']);
- $user->set('defaultsortas', $bugsys->in['defaultsortas']);
+ $user = new UserAPI();
+ $user->set('displayname', $input->in['displayname']);
+ $user->set('email', $input->in['email']);
+ $user->set('showemail', $input->in['showemail']);
+ $user->set('showcolors', $input->in['showcolors']);
+ $user->set('usergroupid', $input->in['usergroupid']);
+ $user->set('groupids', $input->in['groupids']);
+ $user->set('languageid', $input->in['languageid']);
+ $user->set('timezone', $input->in['timezone']);
+ $user->set('usedst', $input->in['usedst']);
+ $user->set('password', $input->in['password']);
+ $user->set('hidestatuses', $input->in['hidestatuses']);
+ $user->set('defaultsortkey', $input->in['defaultsortkey']);
+ $user->set('defaultsortas', $input->in['defaultsortas']);
$user->insert();
// post_insert will set the email options... so we now have to dump them
$db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $user->insertid);
- $bugsys->input_clean('emailopts', TYPE_INT);
- if (is_array($bugsys->in['emailopts']))
+ $input->inputClean('emailopts', TYPE_INT);
+ if (is_array($input->in['emailopts']))
{
- foreach ($bugsys->in['emailopts'] AS $relation => $bitarr)
+ foreach ($input->in['emailopts'] AS $relation => $bitarr)
{
$bitmask = 0;
foreach ($bitarr AS $option => $yes)
if ($_POST['do'] == 'update')
{
- $user = new UserAPI($bugsys);
- $user->set('userid', $bugsys->in['userid']);
+ $user = new UserAPI();
+ $user->set('userid', $input->in['userid']);
$user->set_condition();
- $user->set('displayname', $bugsys->in['displayname']);
- $user->set('email', $bugsys->in['email']);
- $user->set('showemail', $bugsys->in['showemail']);
- $user->set('showcolors', $bugsys->in['showcolors']);
- $user->set('usergroupid', $bugsys->in['usergroupid']);
- $user->set('groupids', $bugsys->in['groupids']);
- $user->set('languageid', $bugsys->in['languageid']);
- $user->set('timezone', $bugsys->in['timezone']);
- $user->set('usedst', $bugsys->in['usedst']);
- $user->set('password', $bugsys->in['password']);
- $user->set('hidestatuses', $bugsys->in['hidestatuses']);
- $user->set('defaultsortkey', $bugsys->in['defaultsortkey']);
- $user->set('defaultsortas', $bugsys->in['defaultsortas']);
+ $user->set('displayname', $input->in['displayname']);
+ $user->set('email', $input->in['email']);
+ $user->set('showemail', $input->in['showemail']);
+ $user->set('showcolors', $input->in['showcolors']);
+ $user->set('usergroupid', $input->in['usergroupid']);
+ $user->set('groupids', $input->in['groupids']);
+ $user->set('languageid', $input->in['languageid']);
+ $user->set('timezone', $input->in['timezone']);
+ $user->set('usedst', $input->in['usedst']);
+ $user->set('password', $input->in['password']);
+ $user->set('hidestatuses', $input->in['hidestatuses']);
+ $user->set('defaultsortkey', $input->in['defaultsortkey']);
+ $user->set('defaultsortas', $input->in['defaultsortas']);
$user->update();
$db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $user->values['userid']);
- $bugsys->input_clean('emailopts', TYPE_INT);
- if (is_array($bugsys->in['emailopts']))
+ $input->inputClean('emailopts', TYPE_INT);
+ if (is_array($input->in['emailopts']))
{
- foreach ($bugsys->in['emailopts'] AS $relation => $bitarr)
+ foreach ($input->in['emailopts'] AS $relation => $bitarr)
{
$bitmask = 0;
foreach ($bitarr AS $option => $yes)
}
}
- $admin->redirect('user.php?do=edit&userid=' . $user->objdata['userid']);
+ $admin->redirect('user.php?do=edit&userid=' . $user->record['userid']);
}
// ###################################################################
if ($edit)
{
- NavLinks::usersEdit($bugsys->in['userid']);
+ NavLinks::usersEdit($input->in['userid']);
$navigator->set_focus('link', 'users-pages-users', 'users-pages');
- $user = new UserAPI($bugsys);
- $user->set('userid', $bugsys->in['userid']);
+ $user = new UserAPI();
+ $user->set('userid', $input->in['userid']);
$user->set_condition();
$user->fetch();
}
if ($edit)
{
- $admin->form_hidden_field('userid', $user->objdata['userid']);
+ $admin->form_hidden_field('userid', $user->record['userid']);
}
$admin->table_start();
- $admin->table_head(($add ? T('Add User') : sprintf(T('Edit User (userid: %1$s)'), $user->objdata['userid'])));
+ $admin->table_head(($add ? T('Add User') : sprintf(T('Edit User (userid: %1$s)'), $user->record['userid'])));
- $admin->row_input(T('Display Name'), 'displayname', $user->objdata['displayname']);
- $admin->row_input(T('Email'), 'email', $user->objdata['email']);
+ $admin->row_input(T('Display Name'), 'displayname', $user->record['displayname']);
+ $admin->row_input(T('Email'), 'email', $user->record['email']);
$admin->row_input(($add ? T('Password') : T('Password (Leave blank for no change)')), 'password');
- foreach ($bugsys->datastore['usergroup'] AS $group)
+ foreach (bugdar::$datastore['usergroup'] AS $group)
{
- $admin->list_item($group['title'], $group['usergroupid'], ($user->objdata['usergroupid'] == $group['usergroupid']));
+ $admin->list_item($group['title'], $group['usergroupid'], ($user->record['usergroupid'] == $group['usergroupid']));
}
$admin->row_list(T('Primary Usergroup'), 'usergroupid');
- $ids = explode(',', $user->objdata['groupids']);
- foreach ($bugsys->datastore['usergroup'] AS $id => $group)
+ $ids = explode(',', $user->record['groupids']);
+ foreach (bugdar::$datastore['usergroup'] AS $id => $group)
{
- if ($id == $user->objdata['usergroupid'])
+ if ($id == $user->record['usergroupid'])
{
continue;
}
}
$admin->row_checkbox(T('Secondary Usergroups'), 'groupids');
- $admin->row_yesno(T('Show Email Publicly'), 'showemail', $user->objdata['showemail']);
- $admin->row_yesno(T('Show Status Colors on Bug Listings'), 'showcolors', $user->objdata['showcolors']);
+ $admin->row_yesno(T('Show Email Publicly'), 'showemail', $user->record['showemail']);
+ $admin->row_yesno(T('Show Status Colors on Bug Listings'), 'showcolors', $user->record['showcolors']);
- foreach ($bugsys->datastore['language'] AS $language)
+ foreach (bugdar::$datastore['language'] AS $language)
{
- $admin->list_item($language['title'], $language['languageid'], ($user->objdata['languageid'] == $language['languageid']));
+ $admin->list_item($language['title'], $language['languageid'], ($user->record['languageid'] == $language['languageid']));
}
$admin->row_list(T('Language'), 'languageid');
foreach ($datef->fetch_timezone_list() AS $value => $string)
{
- $admin->list_item($string, $value, ($user->objdata['timezone'] == $value));
+ $admin->list_item($string, $value, ($user->record['timezone'] == $value));
}
$admin->row_list(T('Timezone'), 'timezone');
- $admin->row_yesno(T('Observe Daylight Savings Time (DST)'), 'usedst', $user->objdata['usedst']);
- $admin->row_text(T('Hidden Statuses on Bug Listing'), construct_option_select('hidestatuses', $bugsys->datastore['status'], $user->objdata['hidestatuses'], 'statusid', 'status', 0, true));
- $admin->row_text(T('Default Sort Order Column'), construct_option_select('defaultsortkey', ListSorter::fetch_by_text(false), $user->objdata['defaultsortkey']));
- $admin->row_text(T('Default Sort Order Direction'), construct_option_select('defaultsortas', ListSorter::fetch_as_text(false), $user->objdata['defaultsortas']));
+ $admin->row_yesno(T('Observe Daylight Savings Time (DST)'), 'usedst', $user->record['usedst']);
+ $admin->row_text(T('Hidden Statuses on Bug Listing'), construct_option_select('hidestatuses', bugdar::$datastore['status'], $user->record['hidestatuses'], 'statusid', 'status', 0, true));
+ $admin->row_text(T('Default Sort Order Column'), construct_option_select('defaultsortkey', ListSorter::fetch_by_text(false), $user->record['defaultsortkey']));
+ $admin->row_text(T('Default Sort Order Direction'), construct_option_select('defaultsortas', ListSorter::fetch_as_text(false), $user->record['defaultsortas']));
$admin->table_end();
$admin->table_start(false);
$admin->table_head(T('Email Options'), 6);
- if ($user->objdata['userid'])
+ if ($user->record['userid'])
{
- $options = $db->query("SELECT * FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $user->objdata['userid']);
- while ($opt = $db->fetch_array($options))
+ $options = $db->query("SELECT * FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $user->record['userid']);
+ foreach ($options as $opt)
{
foreach ($bugsys->emailoptions['notifications'] AS $name => $notif)
{
NavLinks::usersAdd();
$navigator->set_focus('link', 'users-pages-users', 'users-pages');
- if (is_numeric($bugsys->in['userdata']))
+ if (is_numeric($input->in['userdata']))
{
- $bugsys->input_clean('userdata', TYPE_UINT);
- if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $bugsys->in['userdata']))
+ $input->inputClean('userdata', TYPE_UINT);
+ if ($db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $input->in['userdata']))
{
- header('Location: user.php?do=edit&userid=' . $bugsys->in['userdata']);
+ header('Location: user.php?do=edit&userid=' . $input->in['userdata']);
}
else
{
}
else
{
- $bugsys->in['userdata'] = str_replace('%', '\%', $bugsys->in['userdata']);
+ $input->in['userdata'] = str_replace('%', '\%', $input->in['userdata']);
$results = $db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE email LIKE '%" . $bugsys->input_escape('userdata') . "%' OR displayname LIKE '%" . $bugsys->input_escape('userdata') . "%'");
if ($db->num_rows($results) < 1)
$admin->table_head(T('Search Results'), 4);
$admin->table_column_head(array(T('Display Name'), T('Email'), T('User ID'), T('Actions')));
- while ($row = $db->fetch_array($results))
+ foreach ($results as $row)
{
$admin->row_multi_item(array(
$row['displayname'] => 'l',
$admin->table_head(T('Show All Users'), 4);
$admin->table_column_head(array(T('Display Name'), T('Email'), T('User ID'), T('Actions')));
- $count = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user");
+ $count = $db->queryFirst("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user");
$pagination->setTotal($count['count']);
$pagination->splitPages();
$users = $db->query("SELECT * FROM " . TABLE_PREFIX . "user ORDER BY userid ASC LIMIT " . $pagination->fetchLimit($pagination->getPage() - 1) . ", " . $pagination->getPerPage());
- while ($user = $db->fetch_array($users))
+ foreach ($users as $user)
{
$admin->row_multi_item(array(
$user['displayname'] => 'l',
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
require_once('./global.php');
require_once('./includes/api_usergroup.php');
-require_once('./includes/class_api_error.php');
APIError(array(new API_Error_Handler($admin), 'admin_error'));
NavLinks::usersPages();
if ($_REQUEST['do'] == 'kill')
{
- $usergroup = new UsergroupAPI($bugsys);
- $usergroup->set('usergroupid', $bugsys->in['usergroupid']);
+ $usergroup = new UsergroupAPI();
+ $usergroup->set('usergroupid', $input->in['usergroupid']);
$usergroup->set_condition();
$usergroup->delete();
if ($_REQUEST['do'] == 'delete')
{
- if ($bugsys->in['usergroupid'] < 7)
+ if ($input->in['usergroupid'] < 7)
{
$admin->error(T('You can\'t delete a default usergroup.'));
}
- $admin->page_confirm(T('Are you sure you want to delete this usergroup? All users in this group will be set back to the default registered usergroup (id: 2).'), 'usergroup.php', 'kill', array('usergroupid' => $bugsys->in['usergroupid']));
+ $admin->page_confirm(T('Are you sure you want to delete this usergroup? All users in this group will be set back to the default registered usergroup (id: 2).'), 'usergroup.php', 'kill', array('usergroupid' => $input->in['usergroupid']));
}
// ###################################################################
if ($edit)
{
- NavLinks::usergroupsEdit($bugsys->in['usergroupid']);
+ NavLinks::usergroupsEdit($input->in['usergroupid']);
$navigator->set_focus('link', 'users-pages-usergroups', 'users-pages');
}
else
if ($edit OR $clone)
{
- $usergroup = new UsergroupAPI($bugsys);
- $usergroup->set('usergroupid', $bugsys->in['usergroupid']);
+ $usergroup = new UsergroupAPI();
+ $usergroup->set('usergroupid', $input->in['usergroupid']);
$usergroup->set_condition();
$usergroup->fetch();
if ($clone)
{
- $admin->form_hidden_field('cloneid', $usergroup->objdata['usergroupid']);
+ $admin->form_hidden_field('cloneid', $usergroup->record['usergroupid']);
}
else
{
- $admin->form_hidden_field('usergroupid', $usergroup->objdata['usergroupid']);
+ $admin->form_hidden_field('usergroupid', $usergroup->record['usergroupid']);
}
}
else
// Details
$admin->table_start();
$admin->table_head(T('Usergroup Details'));
- $admin->row_input(T('Usergroup Title'), 'title', (($add AND $clone) ? '' : $bugsys->sanitize($usergroup->objdata['title'])));
- $admin->row_input(T('Display Title<div><dfn>This is the title that others will be able to see when comments are posted.</dfn></div>'), 'displaytitle', (($add AND $clone) ? '' : $bugsys->sanitize($usergroup->objdata['displaytitle'])));
+ $admin->row_input(T('Usergroup Title'), 'title', (($add AND $clone) ? '' : $bugsys->sanitize($usergroup->record['title'])));
+ $admin->row_input(T('Display Title<div><dfn>This is the title that others will be able to see when comments are posted.</dfn></div>'), 'displaytitle', (($add AND $clone) ? '' : $bugsys->sanitize($usergroup->record['displaytitle'])));
$admin->table_end();
// Permission
$admin->row_span($group, 'thead', 'center');
foreach ($settings AS $setting => $name)
{
- $admin->row_yesno($name, "perm[$setting]", ($usergroup->objdata['permissions'] & $bugsys->permissions["$setting"]));
+ $admin->row_yesno($name, "perm[$setting]", ($usergroup->record['permissions'] & bugdar::$permissions["$setting"]));
}
}
if ($edit OR $clone)
{
- $perms = $db->query("SELECT fieldid, mask FROM " . TABLE_PREFIX . "bugfieldpermission WHERE usergroupid = " . $usergroup->objdata['usergroupid']);
- while ($perm = $db->fetch_array($perms))
+ $perms = $db->query("SELECT fieldid, mask FROM " . TABLE_PREFIX . "bugfieldpermission WHERE usergroupid = " . $usergroup->record['usergroupid']);
+ foreach ($perms as $perm)
{
$permissions["$perm[fieldid]"] = $perm['mask'];
}
}
$fields = $db->query("SELECT fieldid, name FROM " . TABLE_PREFIX . "bugfield ORDER BY fieldid");
- while ($field = $db->fetch_array($fields))
+ foreach ($fields as $field)
{
unset($listitem);
$admin->list_item(T('No Permission'), 0, $permissions["$field[fieldid]"] == 0);
if ($_POST['do'] == 'insert')
{
- $bugsys->input_clean('perm', TYPE_UINT);
- foreach ($bugsys->in['perm'] AS $permtitle => $binaryswitch)
+ $input->inputClean('perm', TYPE_UINT);
+ foreach ($input->in['perm'] AS $permtitle => $binaryswitch)
{
- $permissionvalue += $bugsys->permissions["$permtitle"] * $binaryswitch;
+ $permissionvalue += bugdar::$permissions["$permtitle"] * $binaryswitch;
}
- $usergroup = new UsergroupAPI($bugsys);
- $usergroup->set('title', $bugsys->in['title']);
- $usergroup->set('displaytitle', $bugsys->in['displaytitle']);
+ $usergroup = new UsergroupAPI();
+ $usergroup->set('title', $input->in['title']);
+ $usergroup->set('displaytitle', $input->in['displaytitle']);
$usergroup->set('permissions', $permissionvalue);
$usergroup->insert();
- $bugsys->input_clean('custom', TYPE_UINT);
- if (is_array($bugsys->in['custom']))
+ $input->inputClean('custom', TYPE_UINT);
+ if (is_array($input->in['custom']))
{
- foreach ($bugsys->in['custom'] AS $fieldid => $mask)
+ foreach ($input->in['custom'] AS $fieldid => $mask)
{
$values[] = $usergroup->insertid . ", " . $bugsys->clean($fieldid, TYPE_UINT) . ", " . $mask;
}
}
// copy product permissions from cloning
- if ($bugsys->input_clean('cloneid', TYPE_UINT))
+ if ($input->inputClean('cloneid', TYPE_UINT))
{
- $prodperms = $db->query("SELECT * FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $bugsys->in['cloneid']);
- while ($prod = $db->fetch_array($prodperms))
+ $prodperms = $db->query("SELECT * FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $input->in['cloneid']);
+ foreach ($prodperms as $prod)
{
$db->query("INSERT INTO " . TABLE_PREFIX . "permission (usergroupid, productid, mask) VALUES (" . $usergroup->insertid . ", $prod[productid], $prod[mask])");
}
if ($_POST['do'] == 'update')
{
- $bugsys->input_clean_array(array(
+ $input->inputClean_array(array(
'perm' => TYPE_UINT,
'usergroupid' => TYPE_UINT,
'custom' => TYPE_UINT
));
- $bugsys->input_clean('perm', TYPE_UINT);
- foreach ($bugsys->in['perm'] AS $permtitle => $binaryswitch)
+ $input->inputClean('perm', TYPE_UINT);
+ foreach ($input->in['perm'] AS $permtitle => $binaryswitch)
{
- $permissionvalue += $bugsys->permissions["$permtitle"] * $binaryswitch;
+ $permissionvalue += bugdar::$permissions["$permtitle"] * $binaryswitch;
}
- $usergroup = new UsergroupAPI($bugsys);
- $usergroup->set('usergroupid', $bugsys->in['usergroupid']);
+ $usergroup = new UsergroupAPI();
+ $usergroup->set('usergroupid', $input->in['usergroupid']);
$usergroup->set_condition();
- $usergroup->set('title', $bugsys->in['title']);
- $usergroup->set('displaytitle', $bugsys->in['displaytitle']);
+ $usergroup->set('title', $input->in['title']);
+ $usergroup->set('displaytitle', $input->in['displaytitle']);
$usergroup->set('permissions', $permissionvalue);
$usergroup->update();
- $bugsys->input_clean('custom', TYPE_UINT);
- if (is_array($bugsys->in['custom']))
+ $input->inputClean('custom', TYPE_UINT);
+ if (is_array($input->in['custom']))
{
- foreach ($bugsys->in['custom'] AS $fieldid => $mask)
+ foreach ($input->in['custom'] AS $fieldid => $mask)
{
$values[] = $usergroup->values['usergroupid'] . ", " . $bugsys->clean($fieldid, TYPE_UINT) . ", " . $mask;
}
if ($_POST['do'] == 'doapprove')
{
- $bugsys->input_clean('approve', TYPE_UINT);
+ $input->inputClean('approve', TYPE_UINT);
$idlist = array();
- if (is_array($bugsys->in['approve']))
+ if (is_array($input->in['approve']))
{
- foreach ($bugsys->in['approve'] AS $id => $yesno)
+ foreach ($input->in['approve'] AS $id => $yesno)
{
if ($yesno > 0)
{
if (sizeof($idlist) > 0)
{
$users = $db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid IN (" . implode(',', $idlist) . ")");
- while ($user = $db->fetch_array($users))
+ foreach ($users as $user)
{
- $tpl = $template->fetch(FetchEmailPath('accountapproved.xml', $bugsys->datastore['language'][$bugsys->options['defaultlanguage']]['langcode']));
+ $tpl = $template->fetch(FetchEmailPath('accountapproved.xml', bugdar::$datastore['language'][bugdar::$options['defaultlanguage']]['langcode']));
eval('$email = "' . $tpl . '";');
$email = $bugsys->xml->parse($email);
$mail->setSubject($email['email']['subject']['value']);
$admin->table_column_head(array(T('Display Name'), T('Usergroup'), T('Approve')));
$users = $db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE usergroupid IN (3, 4)");
- while ($user = $db->fetch_array($users))
+ foreach ($users as $user)
{
$admin->row_multi_item(array(
'<a href="user.php?do=edit&userid=' . $user['userid'] . '">' . $user['email'] . '</a>' => 'l',
- $bugsys->datastore['usergroup']["$user[usergroupid]"]['title'] => 'c',
+ bugdar::$datastore['usergroup']["$user[usergroupid]"]['title'] => 'c',
'<input name="approve[' . $user['userid'] . ']" type="checkbox" value="1" />' => 'c'
));
}
$admin->table_head(T('Usergroup Manager'), 3, 'usergroups');
$groups = $db->query("SELECT * FROM " . TABLE_PREFIX . "usergroup ORDER BY usergroupid ASC");
- while ($group = $db->fetch_array($groups))
+ foreach ($groups as $group)
{
$usergroups["$group[usergroupid]"] = $group;
}
GROUP BY usergroup.usergroupid
ORDER BY usergroup.usergroupid"
);
- while ($group = $db->fetch_array($groups))
+ foreach ($groups as $group)
{
$usergroups["$group[usergroupid]"]['total'] = $group['total'];
}
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
require_once('./includes/api_userhelp.php');
require_once('./includes/functions_datastore.php');
-require_once('./includes/class_api_error.php');
APIError(array(new API_Error_Handler($admin), 'admin_error'));
NavLinks::optionsPages();
if ($_REQUEST['do'] == 'kill')
{
- $help = new UserHelpAPI($bugsys);
- $help->set('keystring', $bugsys->in['keystring']);
+ $help = new UserHelpAPI();
+ $help->set('keystring', $input->in['keystring']);
$help->delete();
build_user_help();
if ($_REQUEST['do'] == 'delete')
{
- $admin->page_confirm(T('Are you sure you want to delete help text?'), 'userhelp.php', 'kill', array('keystring' => $bugsys->in['keystring']));
+ $admin->page_confirm(T('Are you sure you want to delete help text?'), 'userhelp.php', 'kill', array('keystring' => $input->in['keystring']));
}
// ###################################################################
if ($_POST['do'] == 'insert')
{
- $help = new UserHelpAPI($bugsys);
- $help->set('keystring', $bugsys->in['keystring']);
- $help->set('title', $bugsys->in['title']);
- $help->set('body', $bugsys->in['body']);
+ $help = new UserHelpAPI();
+ $help->set('keystring', $input->in['keystring']);
+ $help->set('title', $input->in['title']);
+ $help->set('body', $input->in['body']);
$help->insert();
$admin->redirect('userhelp.php?do=modify');
if ($_POST['do'] == 'update')
{
- foreach ($bugsys->in['help'] AS $keystring => $fields)
+ foreach ($input->in['help'] AS $keystring => $fields)
{
- $help = new UserHelpAPI($bugsys);
+ $help = new UserHelpAPI();
$help->norunners = array('post_update');
$help->set('keystring', $keystring);
$help->set_condition();
$admin->table_head(T('Edit User Help'));
$topics = $db->query("SELECT * FROM " . TABLE_PREFIX . "fieldhelp ORDER BY keystring ASC");
- while ($topic = $db->fetch_array($topics))
+ foreach ($topics as $topic)
{
$inputfield = '<input type="text" class="input" name="help[' . $topic['keystring'] . '][title]" value="' . $topic['title'] . '" size="35" />';
$delete = (!in_array($topic['keystring'], UserHelpAPI::not_able_to_delete()) ? '<br /><br /><a href="userhelp.php?do=delete&keystring=' . $topic['keystring'] . '">[' . T('Delete') . ']</a>' : '');
$admin->page_end();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'editattach'
);
-define('SVN', '$Id$');
$focus['showreport'] = 'focus';
require_once('./global.php');
-require_once('./includes/class_api_error.php');
require_once('./includes/class_notification.php');
require_once('./includes/api_attachment.php');
require_once('./includes/api_comment.php');
-APIError(array(new API_Error_Handler($message), 'user_cumulative'));
-
-if (isset($bugsys->in['attachmentid']))
+if (isset($input->in['attachmentid']))
{
- $attachment = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . $bugsys->input_clean('attachmentid', TYPE_UINT));
+ $attachment = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . $input->inputClean('attachmentid', TYPE_UINT));
if (!$attachment)
{
$message->error(L_INVALID_ID);
}
}
-$bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . (($attachment['attachmentid']) ? $attachment['bugid'] : $bugsys->input_clean('bugid', TYPE_UINT)));
+$bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . (($attachment['attachmentid']) ? $attachment['bugid'] : $input->inputClean('bugid', TYPE_UINT)));
if (!$bug)
{
$message->error(L_INVALID_ID);
require_once('./includes/class_logging.php');
-$notif = new NotificationCenter;
-$notif->set_bug_data($bug);
+$notif = new NotificationCenter();
+$notif->setBugData($bug);
// ###################################################################
if ($_POST['do'] == 'insert')
{
- $attachapi = new AttachmentAPI($bugsys);
- $attachapi->set('bugid', $bugsys->in['bugid']);
+ $attachapi = new AttachmentAPI();
+ $attachapi->set('bugid', $input->in['bugid']);
if (!can_perform('canputattach', $bug['product']))
{
}
// max packet size
- $var = $db->query_first("SHOW VARIABLES LIKE 'max_allowed_packet'");
- $bugsys->debug("max_allowed_packet = $var[Value]");
+ $var = $db->queryFirst("SHOW VARIABLES LIKE 'max_allowed_packet'");
+ BSApp::debug("max_allowed_packet = $var[Value]");
// create alias
- $FILE =& $_FILES['attachment'];
+ $FILE = &$_FILES['attachment'];
// PHP errors
switch ($FILE['error'])
$attachapi->set('filename', $FILE['name']);
$attachapi->set('mimetype', $FILE['type']);
$attachapi->set('filesize', $FILE['size']);
- $attachapi->set('description', $bugsys->in['description']);
- $attachapi->set('userid', $bugsys->userinfo['userid']);
+ $attachapi->set('description', $input->in['description']);
+ $attachapi->set('userid', bugdar::$userinfo['userid']);
// insert an attachment
if (!$message->hasErrors())
{
$attachapi->insert();
- $obsoletes = $bugsys->input_clean('obsoletes', TYPE_UINT);
+ $obsoletes = $input->inputClean('obsoletes', TYPE_UINT);
- $notif->send_new_attachment_notice($attachapi->values, $obsoletes, $attachapi->insertid);
+ $notif->sendNewAttachmentNotice($attachapi->values, $obsoletes, $attachapi->insertid);
// mark obsoletes
if (is_array($obsoletes) AND sizeof($obsoletes) > 0)
{
$db->query("UPDATE " . TABLE_PREFIX . "attachment SET obsolete = 1 WHERE attachmentid IN (" . implode(',', $obsoletes) . ") AND !obsolete AND bugid = $bug[bugid]");
- foreach ($obsoletes AS $attachmentid)
+ foreach ($obsoletes as $attachmentid)
{
$log = new Logging;
- $log->set_bugid($bug['bugid']);
- $log->set_attachmentid($attachmentid);
- $log->add_data(true, array('obsolete' => 0), array('obsolete'), false, 'attachment');
- $log->add_data(false, array('obsolete' => 1), array('obsolete'), false, 'attachment');
- $log->update_history();
+ $log->setBugId($bug['bugid']);
+ $log->setAttachmentId($attachmentid);
+ $log->addData(true, array('obsolete' => 0), array('obsolete'), false, 'attachment');
+ $log->addData(false, array('obsolete' => 1), array('obsolete'), false, 'attachment');
+ $log->updateHistory();
}
}
// handle comment stuff
- if (can_perform('canpostcomments', $bug['product']) AND trim($bugsys->in['comment']))
+ if (can_perform('canpostcomments', $bug['product']) AND trim($input->in['comment']))
{
- $comment = new CommentAPI($bugsys);
- $comment->set('bugid', $bugsys->in['bugid']);
- $comment->set('userid', $bugsys->userinfo['userid']);
- $comment->set('comment', $bugsys->in['comment']);
+ $comment = new CommentAPI();
+ $comment->set('bugid', $input->in['bugid']);
+ $comment->set('userid', bugdar::$userinfo['userid']);
+ $comment->set('comment', $input->in['comment']);
$comment->set('dateline', $attachapi->values['dateline']);
$comment->insert();
- $notif->send_new_comment_notice($comment->values);
+ $notif->sendNewCommentNotice($comment->values);
}
// update the last post data
- $db->query("UPDATE " . TABLE_PREFIX . "bug SET lastposttime = " . $attachapi->values['dateline'] . ", hiddenlastposttime = " . $attachapi->values['dateline'] . ", lastpostby = " . $bugsys->userinfo['userid'] . ", hiddenlastpostby = " . $bugsys->userinfo['userid'] . " WHERE bugid = $bug[bugid]");
+ $db->query("UPDATE " . TABLE_PREFIX . "bug SET lastposttime = " . $attachapi->values['dateline'] . ", hiddenlastposttime = " . $attachapi->values['dateline'] . ", lastpostby = " . bugdar::$userinfo['userid'] . ", hiddenlastpostby = " . bugdar::$userinfo['userid'] . " WHERE bugid = $bug[bugid]");
$notif->finalize();
$message->errorPermission();
}
- $MAXFILESIZE = $funct->fetch_max_attachment_size();
+ $MAXFILESIZE = BSFunctions::fetch_max_php_file_size();
$show['addcomment'] = ((can_perform('canpostcomments', $bug['product'])) ? true : false);
$show['obsoletes'] = false;
$obsoletes_fetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE bugid = $bug[bugid] AND !obsolete");
$obsoletes = '';
- while ($obsolete = $db->fetch_array($obsoletes_fetch))
+ foreach ($obsoletes_fetch as $obsolete)
{
$show['obsoletes'] = true;
- $obsoletes .= "<div><input name=\"obsoletes[]\" type=\"checkbox\" value=\"$obsolete[attachmentid]\"" . (is_array($bugsys->in['obsoletes']) AND in_array($obsolete['attachmentid'], $bugsys->in['obsoletes']) ? ' checked="checked"' : '') . " /> $obsolete[filename]" . ($obsolete['description'] ? " [$obsolete[description]]" : '') . "</div>\n";
+ $obsoletes .= "<div><input name=\"obsoletes[]\" type=\"checkbox\" value=\"$obsolete[attachmentid]\"" . (is_array($input->in['obsoletes']) AND in_array($obsolete['attachmentid'], $input->in['obsoletes']) ? ' checked="checked"' : '') . " /> $obsolete[filename]" . ($obsolete['description'] ? " [$obsolete[description]]" : '') . "</div>\n";
}
- eval('$template->flush("' . $template->fetch('newattach') . '");');
+ $tpl = new BSTemplate('newattach');
+ $tpl->vars = array(
+ 'bug' => $bug,
+ 'message' => $message,
+ 'MAXFILESIZE' => $MAXFILESIZE,
+ 'obsoletes' => $obsoletes,
+ 'input' => $input
+ );
+ $tpl->evaluate()->flush();
}
// ###################################################################
if ($_POST['do'] == 'update')
{
- if (!(can_perform('caneditattach', $bug['product']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['product']))))
+ if (!(can_perform('caneditattach', $bug['product']) OR ($attachment['userid'] == bugdar::$userinfo['userid'] AND can_perform('canputattach', $bug['product']))))
{
$message->errorPermission();
}
- $attachapi = new AttachmentAPI($bugsys);
- $attachapi->set('attachmentid', $bugsys->in['attachmentid']);
- $attachapi->dorelations = array();
- $attachapi->set_condition();
+ $attachapi = new AttachmentAPI();
+ $attachapi->set('attachmentid', $input->in['attachmentid']);
- if ($bugsys->in['__delete__'] != '')
+ if ($input->in['__delete__'] != '')
{
if (!(can_perform('caneditattach', $bug['product']) AND can_perform('candeletedata', $bug['productid'])))
{
$message->errorPermission();
}
- $attachapi->delete();
+ $attachapi->remove();
$message->redirect(T('The attachment was successfully deleted.'), "showreport.php?bugid=$bug[bugid]");
}
else
{
- $log = new Logging;
- $log->set_bugid($bug['bugid']);
- $log->set_attachmentid($bugsys->in['attachmentid']);
+ $log = new Logging();
+ $log->setBugId($bug['bugid']);
+ $log->setAttachmentId($input->in['attachmentid']);
$attachapi->fetch();
- $log->add_data(true, $attachapi->objdata, array('attachment'), true, 'attachment');
+ $log->addData(true, $attachapi->record, array('attachment'), true, 'attachment');
- $attachapi->set('description', $bugsys->in['description']);
- $attachapi->set('obsolete', $bugsys->in['obsolete']);
+ $attachapi->set('description', $input->in['description']);
+ $attachapi->set('obsolete', $input->in['obsolete']);
$attachapi->update();
- $log->add_data(false, $attachapi->values, array('attachment'), true, 'attachment');
+ $log->addData(false, $attachapi->values, array('attachment'), true, 'attachment');
- $log->update_history();
+ $log->updateHistory();
$message->redirect(T('The attachment was successfully modified.'), "showreport.php?bugid=$bug[bugid]");
}
if ($_REQUEST['do'] == 'edit')
{
- if (!(can_perform('caneditattach', $bug['product']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['product']))))
+ if (!(can_perform('caneditattach', $bug['product']) OR ($attachment['userid'] == bugdar::$userinfo['userid'] AND can_perform('canputattach', $bug['product']))))
{
$message->errorPermission();
}
$show['delete'] = (can_perform('caneditattach', $bug['product']) AND can_perform('candeletedata', $bug['productid']));
- eval('$template->flush("' . $template->fetch('editattach') . '");');
+ $tpl = new BSTemplate('editattach');
+ $tpl->vars = array(
+ 'attachment' => $attachment,
+ 'bug' => $bug
+ );
+ $tpl->evaluate()->flush();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
chdir('..');
require_once('./global.php');
-$files = $funct->scandir('templates');
+$files = BSFunctions::scan_directory('templates');
$db->query("TRUNCATE TABLE " . TABLE_PREFIX . "template");
{
foreach ($bits AS $file)
{
- if ($funct->fetch_extension($file) == 'tpl')
+ if (BSFunctions::fetch_extension($file) == 'tpl')
{
$db->query("INSERT INTO " . TABLE_PREFIX . "template (filename, template, timestamp) VALUES ('$path" . substr($file, 0, strlen($file) - 4) . "', '" . $db->escape_string($template->_parse(file_get_contents("templates/$path$file"))) . "', " . time() . ")");
}
foreach ($THELIST AS $display => $data)
{
$fetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "$data[table]" . (!$data['orderfree'] ? " ORDER BY {$data[table]}id ASC" : ""));
- while ($fitem = $db->fetch_array($fetch))
+ foreach ($fetch as $fitem)
{
$exportlist["$display"][] = $fitem;
}
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
FILE;
$settings = $db->query("SELECT * FROM " . TABLE_PREFIX . "setting");
- while ($setting = $db->fetch_array($settings))
+ foreach ($settings as $setting)
{
$fout .= "\n\t'$setting[varname]' => '" . str_replace("'", "\'", $setting['value']) . "',";
}
--- /dev/null
+Bugdar PHASES OF DEVELOPMENT
+================================================================================
+
+Because Bugdar 2.0 is a substantial development effort, its progress will be
+broken into unique, defined stages. No time will be allotted to these stages
+because this is only to group different phases of development.
+
+PHASE 1: ISSO CONVERSION
+###########################################
+- Upgrade the infrastructure of Bugdar to use ISSO3
+- Straight swap-out of ISSO2 components to v3
+- The 1.2.x series running under ISSO3
+- Exception of the Admin CP, because the BSPrinter modules are being removed
+
+
+PHASE 2: PRINTER MODULE SPRINT DEVELOPMENT
+###########################################
+- Remove the ISSO3 Printer modules
+- Replace with CSS stylesheets that use extremely-semenatic markup
+- Rewrite the Admin CP to use templates with new stylesheets
+
+
+PHASE 3: REWRITE LANGUAGE SYSTEM
+###########################################
+- Switch from using Gettext MO files to a database-phrase system
+- Database system will enable translation of dynamic data (help system, field
+names, statuses, etc.)
+- Use phrase groups to prevent loading of all phrases into memory
+- XML export system
+
+
+PHASE 4: CORE REFACTORING
+###########################################
+- Refactor core code components to use more API functions to reduce controller
+code
+- Make projects more independent, allowing for product-specific custom fields,
+etc.
+- Re-envision Bugdar
+
+
+PHASE 5: NEW FEATURES
+###########################################
+- Add new features from the bug database and planning_2_0.txt
+
+
+PHASE 6: INTERFACE REDESIGN
+###########################################
+- Redesign interface
+- AJAX where possible
+
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
{
chdir('../');
}
-require_once('./global.php');
+require_once './global.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<?php
-if (empty($bugsys->in['__submit__']))
+if (empty($input->in['__submit__']))
{
?>
Sendmail (From): \"" . ini_get('sendmail_from') . "\"
Sendmail (Path): \"" . ini_get('sendmail_path') . "\"";
+ require_once ISSO . '/Mail.php';
+ $mail = new BSMail();
$mail->setFromName('Bugdar Mailing Test');
$mail->setSubject('Email Tests');
- if (empty($bugsys->in['receive']) OR empty($bugsys->in['sender']) OR !$funct->is_valid_email($bugsys->in['receive']) OR !$funct->is_valid_email($bugsys->in['sender']))
+ if (empty($input->in['receive']) OR empty($input->in['sender']) OR !BSFunctions::is_valid_email($input->in['receive']) OR !BSFunctions::is_valid_email($input->in['sender']))
{
echo '<p style="color: red">You did not fill in all the fields or the email addresses are not valid. Please <a href="mailtest.php">go back</a>.</p>';
}
{
// normal Bugdar mailing
$mail->setBodyText(sprintf($text, 1, 'sending with the Bugdar-configured address'));
- $mail->send($bugsys->in['receive']);
+ $mail->setFromAddress(bugdar::$options['webmasteremail']);
+ $mail->send($input->in['receive']);
// mail from the alternate address
$mail->setBodyText(sprintf($text, 2, 'sending from the address you specified that exists on the mail server'));
- $mail->setFromAddress($bugsys->in['sender']);
- $mail->send($bugsys->in['receive']);
+ $mail->setFromAddress($input->in['sender']);
+ $mail->send($input->in['receive']);
// mail from self
$mail->setBodyText(sprintf($text, 3, 'sending from the receiving address'));
- $mail->setFromAddress($bugsys->in['receive']);
- $mail->send($bugsys->in['receive']);
+ $mail->setFromAddress($input->in['receive']);
+ $mail->send($input->in['receive']);
// mail from non-existent
$mail->setBodyText(sprintf($text, 4, 'sending from a non-existent address'));
- $mail->setFromAddress(preg_replace('#(.*)@(.*)#', 'bugdar-mail-test@\2', $bugsys->in['receive']));
- $mail->send($bugsys->in['receive']);
+ $mail->setFromAddress(preg_replace('#(.*)@(.*)#', 'bugdar-mail-test@\2', $input->in['receive']));
+ $mail->send($input->in['receive']);
?>
<h2>Complete</h2>
- <p>All the test emails were sent to <em><?= $bugsys->in['receive'] ?></em>. Please check that you received all 4 tests.</p>
+ <p>All the test emails were sent to <em><?= $input->in['receive'] ?></em>. Please check that you received all 4 tests.</p>
<?php
}
</html>
<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
// gets all the fields
$fields = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield");
-while ($field = $db->fetch_array($fields))
+foreach ($fields as $field)
{
// create the database field
$db->query("ALTER TABLE " . TABLE_PREFIX . "bug ADD custom$field[fieldid] MEDIUMTEXT NULL");
// update all the data
$data = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugvaluefill");
- while ($custom = $db->fetch_array($data))
+ foreach ($data as $custom)
{
$db->query("UPDATE " . TABLE_PREFIX . "bug SET custom$field[fieldid] = '" . $db->escape_string($custom["field$field[fieldid]"]) . "' WHERE bugid = $custom[bugid]");
}
for ($i = 11; $i < 111; $i++)
{
- $bug = new BugAPI($bugsys);
- $comment = new CommentAPI($bugsys);
+ $bug = new BugAPI();
+ $comment = new CommentAPI();
- $bug->set('userid', $bugsys->userinfo['userid']);
- $bug->set('username', $bugsys->userinfo['displayname']);
+ $bug->set('userid', bugdar::$userinfo['userid']);
+ $bug->set('username', bugdar::$userinfo['displayname']);
$bug->set('summary', 'AUTO POPULATE: ' . $i);
$bug->set('severity', 1);
- $comment->set('userid', $bugsys->userinfo['userid']);
- $comment->set('comment', $funct->rand(100));
+ $comment->set('userid', bugdar::$userinfo['userid']);
+ $comment->set('comment', BSFunctions::random(100));
- $bug->set('priority', $bugsys->options['defaultpriority']);
- $bug->set('status', $bugsys->options['defaultstatus']);
- $bug->set('resolution', $bugsys->options['defaultresolve']);
- $bug->set('assignedto', $bugsys->options['defaultassign']);
+ $bug->set('priority', bugdar::$options['defaultpriority']);
+ $bug->set('status', bugdar::$options['defaultstatus']);
+ $bug->set('resolution', bugdar::$options['defaultresolve']);
+ $bug->set('assignedto', bugdar::$options['defaultassign']);
$bug->set('product', 6);
$bug->set('component', 0);
$comment->set('bugid', $bug->insertid);
$comment->insert();
- $bug = new BugAPI($bugsys); // need to destroy because update will think the insert fields need to be changed, too
+ $bug = new BugAPI(); // need to destroy because update will think the insert fields need to be changed, too
$bug->dorelations = array();
$bug->set('bugid', $comment->values['bugid']);
$bug->set_condition();
$bug->set('dateline', $comment->values['dateline']);
$bug->set('initialreport', $comment->insertid);
$bug->set('lastposttime', $comment->values['dateline']);
- $bug->set('lastpostby', $bugsys->userinfo['userid']);
- $bug->set('lastpostbyname', $bugsys->userinfo['displayname']);
+ $bug->set('lastpostby', bugdar::$userinfo['userid']);
+ $bug->set('lastpostbyname', bugdar::$userinfo['displayname']);
$bug->set('hiddenlastposttime', $comment->values['dateline']);
- $bug->set('hiddenlastpostby', $bugsys->userinfo['userid']);
- $bug->set('hiddenlastpostbyname', $bugsys->userinfo['displayname']);
+ $bug->set('hiddenlastpostby', bugdar::$userinfo['userid']);
+ $bug->set('hiddenlastpostbyname', bugdar::$userinfo['displayname']);
$bug->update();
}
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
foreach ($matches[5] AS $id)
{
- $api = new BugAPI($bugsys);
+ $api = new BugAPI();
$api->set('bugid', $id);
$api->set_condition();
$api->set('status', 4);
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
echo '<pre>';
-print_r($bugsys);
+print_r(get_class_vars('bugdar'));
echo '</pre>';
$userlist = array();
$users = $db->query("SELECT userid, displayname FROM " . TABLE_PREFIX . "user");
-while ($user = $db->fetch_array($users))
+foreach ($users as $user)
{
$userlist["$user[userid]"] = $user['displayname'];
}
$bugs = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug");
-while ($bug = $db->fetch_array($bugs))
+foreach ($bugs as $bug)
{
$db->query("
UPDATE " . TABLE_PREFIX . "bug
$comments = $db->query("SELECT * FROM " . TABLE_PREFIX . "comment ORDER BY bugid, dateline ASC");
-while ($comment = $db->fetch_array($comments))
+foreach ($comments as $comment)
{
if (!isset($replace["$comment[bugid]"]))
{
);
$bugs = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug");
-while ($bug = $db->fetch_array($bugs))
+foreach ($bugs as $bug)
{
$db->query("UPDATE " . TABLE_PREFIX . "bug SET priority = " . $fields['priority']["$bug[priority]"] . ", severity = " . $fields['severity']["$bug[severity]"] . " WHERE bugid = " . $bug['bugid']);
}
$severity = $db->query("SELECT * FROM " . TABLE_PREFIX . "severity");
-while ($thing = $db->fetch_array($severity))
+foreach ($severity as $thing)
{
$db->query("UPDATE " . TABLE_PREFIX . "severity SET severityid = " . rand(10, 100000) . " WHERE severityid = $thing[severityid]");
}
$priority = $db->query("SELECT * FROM " . TABLE_PREFIX . "priority");
-while ($thing = $db->fetch_array($priority))
+foreach ($priority as $thing)
{
$db->query("UPDATE " . TABLE_PREFIX . "priority SET priorityid = " . rand(10, 100000) . " WHERE priorityid = $thing[priorityid]");
}
$total = $nodo = 0;
$history = $db->query("SELECT * FROM " . TABLE_PREFIX . "history");
-while ($log = $db->fetch_array($history))
+foreach ($history as $log)
{
$matches = array();
if (preg_match('#custom_field([0-9]+?)#i', $log['field'], $matches))
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'editcomment'
);
-define('SVN', '$Id$');
$focus['showreport'] = 'focus';
require_once('./global.php');
require_once('./includes/api_comment.php');
-require_once('./includes/class_api_error.php');
-APIError(array(new API_Error_Handler($message), 'user_cumulative'));
-$commentapi = new CommentAPI($bugsys);
-$commentapi->set('commentid', $bugsys->in['commentid']);
-$commentapi->set_condition();
+$commentapi = new CommentAPI();
+$commentapi->set('commentid', $input->in['commentid']);
$commentapi->fetch();
-$comment =& $commentapi->objdata;
+$comment = &$commentapi->record;
-$bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $comment[bugid]");
+$bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $comment[bugid]");
if (!check_bug_permissions($bug))
{
}
// get the last post (as in prior to deletion)
- $lastpost = $db->query_first("SELECT commentid FROM " . TABLE_PREFIX . "comment WHERE bugid = $bug[bugid] ORDER BY dateline DESC");
+ $lastpost = $db->queryFirst("SELECT commentid FROM " . TABLE_PREFIX . "comment WHERE bugid = $bug[bugid] ORDER BY dateline DESC");
- $commentapi->delete();
+ $commentapi->remove();
// check to see if we need to rebuild the lastpost information
if ($lastpost['commentid'] == $comment['commentid'])
{
- $lastgoodpublic = $db->query_first("
+ $lastgoodpublic = $db->queryFirst("
SELECT comment.* AS comment, user.displayname AS username
FROM " . TABLE_PREFIX . "comment AS comment
LEFT JOIN " . TABLE_PREFIX . "user AS user
WHERE bugid = $bug[bugid]
AND !hidden ORDER BY dateline DESC
");
- $lastgoodprivate = $db->query_first("
+ $lastgoodprivate = $db->queryFirst("
SELECT comment.* AS comment, user.displayname AS username
FROM " . TABLE_PREFIX . "comment AS comment
LEFT JOIN " . TABLE_PREFIX . "user AS user
UPDATE " . TABLE_PREFIX . "bug
SET hiddenlastposttime = $lastgoodpublic[dateline],
hiddenlastpostby = $lastgoodpublic[userid],
- hiddenlastpostbyname = '" . $db->escape_string($lastgoodpublic['username']) . "',
+ hiddenlastpostbyname = '" . $db->escapeString($lastgoodpublic['username']) . "',
lastposttime = $lastgoodprivate[dateline],
lastpostby = $lastgoodprivate[userid],
- lastpostbyname = '" . $db->escape_string($lastgoodprivate['username']) . "'
+ lastpostbyname = '" . $db->escapeString($lastgoodprivate['username']) . "'
WHERE bugid = $bug[bugid]"
);
}
if ($_POST['do'] == 'update')
{
- if (!((can_perform('caneditownreply', $bug['product']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['product']) AND $bugsys->userinfo['userid'] != $comment['userid'])))
+ if (!((can_perform('caneditownreply', $bug['product']) AND bugdar::$userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['product']) AND bugdar::$userinfo['userid'] != $comment['userid'])))
{
$message->errorPermission();
}
- $commentapi->set('comment', $bugsys->in['comment']);
- $commentapi->set('parselinks', $bugsys->in['parselinks']);
- $commentapi->set('hidden', $bugsys->in['hidden']);
+ $commentapi->set('comment', $input->in['comment']);
+ $commentapi->set('parselinks', $input->in['parselinks']);
+ $commentapi->set('hidden', $input->in['hidden']);
- if ($bugsys->in['commentid'] == $bug['initialreport'] AND $bugsys->in['hidden'])
+ if ($input->in['commentid'] == $bug['initialreport'] AND $input->in['hidden'])
{
$message->addError(T('You cannot hide the first comment/initial report of a bug. Instead, hide the entire bug.'));
}
// setup logging
require_once('./includes/class_logging.php');
$log = new Logging;
- $log->set_bugid($bug['bugid']);
- $log->set_commentid($comment['commentid']);
+ $log->setBugId($bug['bugid']);
+ $log->setCommentId($comment['commentid']);
- $log->add_data(true, $commentapi->objdata, array('comment', 'hidden'), false, 'comment');
- $log->add_data(false, $commentapi->values, array('comment', 'hidden'), false, 'comment');
+ $log->addData(true, $commentapi->record, array('comment', 'hidden'), false, 'comment');
+ $log->addData(false, $commentapi->values, array('comment', 'hidden'), false, 'comment');
- $lastgood = $db->query_first("
+ $lastgood = $db->queryFirst("
SELECT comment.* AS comment, user.displayname AS username
FROM " . TABLE_PREFIX . "comment AS comment
LEFT JOIN " . TABLE_PREFIX . "user AS user
UPDATE " . TABLE_PREFIX . "bug
SET hiddenlastposttime = $lastgood[dateline],
hiddenlastpostby = $lastgood[userid],
- hiddenlastpostbyname = '" . $db->escape_string($lastgood['username']) . "'
+ hiddenlastpostbyname = '" . $db->escapeString($lastgood['username']) . "'
WHERE bugid = $bug[bugid]"
);
- $log->update_history();
+ $log->updateHistory();
$message->redirect(T('The comment was modified successfully.'), "showreport.php?bugid=$bug[bugid]");
}
{
$show['errors'] = true;
$_REQUEST['do'] = 'edit';
- $comment['comment'] = $bugsys->in['comment'];
- $comment['hidden'] = $bugsys->in['hidden'];
+ $comment['comment'] = $input->in['comment'];
+ $comment['hidden'] = $input->in['hidden'];
}
}
if ($_REQUEST['do'] == 'edit')
{
- if (!((can_perform('caneditownreply', $bug['product']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['product']) AND $bugsys->userinfo['userid'] != $comment['userid'])))
+ if (!((can_perform('caneditownreply', $bug['product']) AND bugdar::$userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['product']) AND bugdar::$userinfo['userid'] != $comment['userid'])))
{
$message->errorPermission();
}
- $comment['posttime'] = $datef->format($bugsys->options['dateformat'], $comment['dateline']);
+ $comment['posttime'] = $datef->format(bugdar::$options['dateformat'], $comment['dateline']);
if ($comment['userid'])
{
- $commenter = new UserAPI($bugsys);
+ $commenter = new UserAPI();
$commenter->set('userid', $comment['userid']);
- $commenter->set_condition();
$commenter->fetch();
- $commenter = $commenter->objdata;
+ $commenter = $commenter->record;
}
$comment['postby'] = construct_user_display($commenter);
- $comment['comment'] = $bugsys->sanitize($comment['comment']);
- $show['hide'] = ($bug['initialreport'] != $comment['commentid'] ? true : false);
- eval('$template->flush("' . $template->fetch('editcomment') . '");');
+ $comment['comment'] = $input->sanitize($comment['comment']);
+ $show['hide'] = ($bug['initialreport'] != $comment['commentid']);
+
+ $tpl = new BSTemplate('editcomment');
+ $tpl->vars = array(
+ 'comment' => $comment,
+ 'bug' => $bug
+ );
+ $tpl->evaluate()->flush();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
|| ###################################################################
\*=====================================================================*/
-define('SVN', '$Id$');
$focus['showreport'] = 'focus';
require_once('./includes/api_bug.php');
require_once('./includes/api_comment.php');
-require_once('./includes/class_api_error.php');
-APIError(array(new API_Error_Handler($message), 'user_cumulative'));
-
-$bug = $db->query_first("
+$bug = $db->queryFirst("
SELECT bug.*, user.email, user.displayname, user.showemail
FROM " . TABLE_PREFIX . "bug AS bug
LEFT JOIN " . TABLE_PREFIX . "user AS user
ON (bug.userid = user.userid)
- WHERE bug.bugid = " . $bugsys->input_clean('bugid', TYPE_UINT)
+ WHERE bug.bugid = " . $input->inputClean('bugid', TYPE_UINT)
);
if (!$bug)
// setup logging
require_once('./includes/class_logging.php');
-$log = new Logging;
-$log->set_bugid($bug['bugid']);
+$log = new Logging();
+$log->setBugId($bug['bugid']);
-$notif = new NotificationCenter;
+$notif = new NotificationCenter();
-$bugapi = new BugAPI($bugsys);
-$bugapi->set('bugid', $bugsys->in['bugid']);
-$bugapi->set_condition();
-$bugapi->dorelations = array();
+$bugapi = new BugAPI();
+$bugapi->set('bugid', $input->in['bugid']);
$bugapi->fetch();
// ###################################################################
$message->errorPermission();
}
- $bugapi->delete();
+ $bugapi->remove();
$message->redirect(T('The entire bug has been deleted.'), 'index.php');
}
if ($_POST['do'] == 'update')
{
- if (!((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid'])) AND !can_perform('canpostcomments', $bug['product']))
+ if (!((can_perform('caneditown', $bug['product']) && bugdar::$userinfo['userid'] == $bug['userid']) || (can_perform('caneditother', $bug['product']) && bugdar::$userinfo['userid'] != $bug['userid'])) && !can_perform('canpostcomments', $bug['product']))
{
$message->errorPermission();
}
- $log->add_data(true, $bugapi->objdata, $log->getCommonFields(), true);
+ $log->addData(true, $bugapi->record, $log->getCommonFields(), true);
// -------------------------------------------------------------------
// handle automations
- if ($bugsys->in['automation'])
+ if ($input->in['automation'])
{
- $automation = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "automation WHERE actionid = " . $bugsys->input_clean('automation', TYPE_UINT));
+ $automation = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "automation WHERE actionid = " . $input->inputClean('automation', TYPE_UINT));
if ($automation)
{
$automation['fields'] = unserialize($automation['fieldchanges']);
{
foreach ($automation['fields']['builtin'] AS $field => $value)
{
- $bugsys->in["$field"] = $value;
+ $input->in["$field"] = $value;
}
}
{
foreach ($automation['fields']['custom'] AS $field => $value)
{
- $bugsys->in["custom$field"] = $value;
+ $input->in["custom$field"] = $value;
}
}
}
// -------------------------------------------------------------------
// process comment stuff
- if ($bugsys->in['comment'] OR $automation['comment'])
+ if ($input->in['comment'] OR $automation['comment'])
{
- if (!empty($bugsys->in['comment']) AND $automation['comment'])
+ if (!empty($input->in['comment']) AND $automation['comment'])
{
- $commenttext = $bugsys->in['comment'] . "\n\n" . T('--------------- AUTOMATIC RESPONSE ---------------') . "\n" . $automation['comment'];
+ $commenttext = $input->in['comment'] . "\n\n" . T('--------------- AUTOMATIC RESPONSE ---------------') . "\n" . $automation['comment'];
}
- else if (empty($bugsys->in['comment']) AND $automation['comment'])
+ else if (empty($input->in['comment']) AND $automation['comment'])
{
$commenttext = $automation['comment'];
}
else
{
- $commenttext = $bugsys->in['comment'];
+ $commenttext = $input->in['comment'];
}
- $comment = new CommentAPI($bugsys);
- $comment->set('bugid', $bugsys->in['bugid']);
- $comment->set('userid', $bugsys->userinfo['userid']);
+ $comment = new CommentAPI();
+ $comment->set('bugid', $input->in['bugid']);
+ $comment->set('userid', bugdar::$userinfo['userid']);
$comment->set('comment', $commenttext);
- $comment->set('parselinks', $bugsys->in['parselinks']);
+ $comment->set('parselinks', $input->in['parselinks']);
$comment->insert();
// we redefine the bug data later, but it needs to be here in order to generate the user list
- $notif->set_bug_data($bugapi->objdata);
- $notif->send_new_comment_notice($comment->values);
+ $notif->setBugData($bugapi->record);
+ $notif->sendNewCommentNotice($comment->values);
$bugapi->set('lastposttime', $comment->values['dateline']);
- $bugapi->set('lastpostby', $bugsys->userinfo['userid']);
- $bugapi->set('lastpostbyname', $bugsys->userinfo['displayname']);
+ $bugapi->set('lastpostby', bugdar::$userinfo['userid']);
+ $bugapi->set('lastpostbyname', bugdar::$userinfo['displayname']);
$bugapi->set('hiddenlastposttime', $comment->values['dateline']);
- $bugapi->set('hiddenlastpostby', $bugsys->userinfo['userid']);
- $bugapi->set('hiddenlastpostbyname', $bugsys->userinfo['displayname']);
+ $bugapi->set('hiddenlastpostby', bugdar::$userinfo['userid']);
+ $bugapi->set('hiddenlastpostbyname', bugdar::$userinfo['displayname']);
- if (!((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid'])))
+ if (!((can_perform('caneditown', $bug['product']) AND bugdar::$userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND bugdar::$userinfo['userid'] != $bug['userid'])))
{
$bugapi->update();
$notif->finalize();
// -------------------------------------------------------------------
// do update stuff
- $dependencies = preg_split('#([^0-9].*?)#', $bugsys->in['dependency'], -1, PREG_SPLIT_NO_EMPTY);
+ $dependencies = preg_split('#([^0-9].*?)#', $input->in['dependency'], -1, PREG_SPLIT_NO_EMPTY);
$dependencies = ((sizeof($dependencies) < 1) ? '' : implode(', ', $dependencies));
- if ((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid']))
+ if ((can_perform('caneditown', $bug['product']) && bugdar::$userinfo['userid'] == $bug['userid']) || (can_perform('caneditother', $bug['product']) && bugdar::$userinfo['userid'] != $bug['userid']))
{
- $bugapi->set('summary', $bugsys->in['summary']);
- $bugapi->set('severity', $bugsys->in['severity']);
- $bugapi->set('duplicateof', $bugsys->in['duplicateof']);
+ $bugapi->set('summary', $input->in['summary']);
+ $bugapi->set('severity', $input->in['severity']);
+ $bugapi->set('duplicateof', $input->in['duplicateof']);
$bugapi->set('dependency', $dependencies);
- $bugapi->set('hidden', $bugsys->in['hidden']);
+ $bugapi->set('hidden', $input->in['hidden']);
- $product = explode(',', $bugsys->in['product']);
+ $product = explode(',', $input->in['product']);
$bugapi->set('product', $product[0]);
$bugapi->set('component', $product[1]);
$bugapi->set('version', $product[2]);
if (can_perform('canchangestatus', $bug['product']))
{
- $bugapi->set('priority', $bugsys->in['priority']);
- $bugapi->set('status', $bugsys->in['status']);
- $bugapi->set('resolution', $bugsys->in['resolution']);
+ $bugapi->set('priority', $input->in['priority']);
+ $bugapi->set('status', $input->in['status']);
+ $bugapi->set('resolution', $input->in['resolution']);
}
if (can_perform('canassign', $bug['product']))
{
- $bugapi->set('assignedto', $bugsys->in['assignedto']);
+ $bugapi->set('assignedto', $input->in['assignedto']);
}
process_custom_fields($bugapi, $message, false);
// -------------------------------------------------------------------
// handle logging and perform updates
- $notif->set_bug_data($bugapi->objdata, array_merge($bugapi->objdata, $bugapi->values));
- $log->add_data(false, $bugapi->values, $log->getCommonFields(), true);
+ $notif->setBugData($bugapi->record, array_merge($bugapi->record, $bugapi->values));
+ $log->addData(false, $bugapi->values, $log->getCommonFields(), true);
if (!$message->hasErrors())
{
// -------------------------------------------------------------------
// do diff history
- $log->update_history();
+ $log->updateHistory();
- $notif->send_bug_changes_notice();
+ $notif->sendBugChangeNotice();
$notif->finalize();
$message->redirect(T('Your changes to the bug have been saved.'), "showreport.php?bugid=$bug[bugid]");
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'explain_row'
);
-define('SVN', '$Id$');
$focus['showreport'] = 'focus';
if ($_REQUEST['do'] == 'products')
{
- if (!is_array($bugsys->datastore['product']))
+ if (!is_array(bugdar::$datastore['product']))
{
$message->error(T('There are no products set up.'));
}
- foreach ($bugsys->datastore['product'] AS $product)
+ foreach (bugdar::$datastore['product'] AS $product)
{
if ($product['parentid'])
{
}
}
- foreach ($bugsys->datastore['version'] AS $version)
+ foreach (bugdar::$datastore['version'] AS $version)
{
$versions["$version[productid]"]["$version[versionid]"] = $version;
}
// global versions
if (is_array($versions['0']))
{
- foreach ($versions['0'] AS $version)
+ foreach ($versions['0'] as $version)
{
- $left = $version['version'];
- $right = null;
- eval('$globalversions .= "' . $template->fetch('explain_row') . '";');
+ $tpl = new BSTemplate('explain_row');
+ $tpl->vars = array(
+ 'left' => $version['version'],
+ );
+ $globalversions .= $tpl->evaluate()->getTemplate();
}
}
- foreach ($products AS $product)
+ foreach ($products as $product)
{
- $left = $product['title'];
- $right = $product['description'];
- $trextra = ' class="altcolor"';
- eval('$productlist .= "' . $template->fetch('explain_row') . '";');
+ $tpl = new BSTemplate('explain_row');
+ $tpl->vars = array(
+ 'left' => $product['title'],
+ 'right' => $product['description'],
+ 'trextra' => ' class="altcolor"'
+ );
+ $productlist .= $tpl->evaluate()->getTemplate();
if (is_array($components["$product[productid]"]))
{
- foreach ($components["$product[productid]"] AS $component)
+ foreach ($components["$product[productid]"] as $component)
{
- $left = ' › ' . $component['title'];
- $right = $component['description'];
- $trextra = '';
- eval('$productlist .= "' . $template->fetch('explain_row') . '";');
+ $tpl = new BSTemplate('explain_row');
+ $tpl->vars = array(
+ 'left' => ' › ' . $component['title'],
+ 'right' => $component['description'],
+ );
+ $productlist .= $tpl->evaluate()->getTemplate();
}
}
}
- eval('$template->flush("' . $template->fetch('explain_product') . '");');
+ $tpl = new BSTemplate('explain_product');
+ $tpl->vars = array(
+ 'globalversions' => $globalversions,
+ 'productlist' => $productlist
+ );
+ $tpl->evaluate()->flush();
}
// ###################################################################
if ($_REQUEST['do'] == 'automations')
{
- $fields_fetch = $bugsys->db->query("
+ $fields_fetch = $db->query("
SELECT bugfield.*, MAX(permission.mask) AS mask
FROM " . TABLE_PREFIX . "bugfield AS bugfield
LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission
ON (bugfield.fieldid = permission.fieldid)
WHERE (permission.mask = 2 OR permission.mask = 1)
- AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ")
+ AND permission.usergroupid IN (" . bugdar::$userinfo['usergroupid'] . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ")
GROUP BY (bugfield.fieldid)
");
- while ($field = $bugsys->db->fetch_array($fields_fetch))
+ foreach ($fields_fetch as $field)
{
$fields["$field[fieldid]"] = $field;
}
- if (is_array($bugsys->datastore['automation']))
+ if (is_array(bugdar::$datastore['automation']))
{
- foreach ($bugsys->datastore['automation'] AS $automation)
+ foreach (bugdar::$datastore['automation'] as $automation)
{
$automation['fieldchanges'] = unserialize($automation['fieldchanges']);
- $left = $automation['name'];
- $right = $automation['description'];
- $trextra = ' class="listinghead"';
-
- eval('$automations .= "' . $template->fetch('explain_row') . '";');
+ $tpl = new BSTemplate('explain_row');
+ $tpl->vars = array(
+ 'left' => $automation['name'],
+ 'right' => $automation['description'],
+ 'trextra' => ' class="listinghead"'
+ );
+ $automations .= $tpl->evaluate()->getTemplate();
if ($automation['comment'])
{
- $left = T('Add Comment');
- $right = $automation['comment'];
- $trextra = ' class="altcolor"';
-
- eval('$automations .= "' . $template->fetch('explain_row') . '";');
+ $tpl = new BSTemplate('explain_row');
+ $tpl->vars = array(
+ 'left' => T('Add Comment'),
+ 'right' => $automation['comment'],
+ 'trextra' => ' class="altcolor"'
+ );
+ $automations .= $tpl->evaluate()->getTemplate();
}
$trextra = '';
{
foreach ($automation['fieldchanges']['builtin'] AS $name => $value)
{
- $left = $name;
- $right = $bugsys->datastore["$left"]["$value"]["$left"];
- eval('$automations .= "' . $template->fetch('explain_row') . '";');
+ $tpl = new BSTemplate('explain_row');
+ $tpl->vars = array(
+ 'left' => $name,
+ 'right' => bugdar::$datastore["$name"]["$value"]["$name"],
+ );
+ $automations .= $tpl->evaluate()->getTemplate();
}
}
continue;
}
- $left = $fields["$id"]['name'] . ' ' . sprintf(T('(Custom #%1$d, type: %2$s)'), $id, $fields["$id"]['type']);
- $right = $value;
- eval('$automations .= "' . $template->fetch('explain_row') . '";');
+ $tpl = new BSTemplate('explain_row');
+ $tpl->vars = array(
+ 'left' => $fields["$id"]['name'] . ' ' . sprintf(T('(Custom #%1$d, type: %2$s)'), $id, $fields["$id"]['type']),
+ 'right' => $value,
+ );
+ $automations .= $tpl->evaluate()->getTemplate();
}
}
}
}
- eval('$template->flush("' . $template->fetch('explain_automation') . '");');
+ $tpl = new BSTemplate('explain_automation');
+ $tpl->vars = array('automations' => $automations);
+ $tpl->evaluate()->flush();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-define('SVN', '$Id$');
if (empty($_REQUEST['do']))
{
if ($_REQUEST['do'] == 'handle')
{
- $bugsys->input_clean('bugid', TYPE_UINT);
- $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $bugsys->in['bugid']);
+ $input->inputClean('bugid', TYPE_UINT);
+ $bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $input->in['bugid']);
if (!check_bug_permissions($bug))
{
$message->errorPermission();
$message->errorPermission();
}
- if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid']))
+ if ($db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . bugdar::$userinfo['userid'] . " AND bugid = " . $input->in['bugid']))
{
- $db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid']);
- $message->redirect(T('This bug has been removed from your favorites list.'), "showreport.php?bugid=" . $bugsys->in['bugid']);
+ $db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE userid = " . bugdar::$userinfo['userid'] . " AND bugid = " . $input->in['bugid']);
+ $message->redirect(T('This bug has been removed from your favorites list.'), "showreport.php?bugid=" . $input->in['bugid']);
}
else
{
- $db->query("INSERT INTO " . TABLE_PREFIX . "favorite (userid, bugid) VALUES (" . $bugsys->userinfo['userid'] . ", " . $bugsys->in['bugid'] . ")");
- $message->redirect(T('This bug has been added to your favorites list.'), "showreport.php?bugid=" . $bugsys->in['bugid']);
+ $db->query("INSERT INTO " . TABLE_PREFIX . "favorite (userid, bugid) VALUES (" . bugdar::$userinfo['userid'] . ", " . $input->in['bugid'] . ")");
+ $message->redirect(T('This bug has been added to your favorites list.'), "showreport.php?bugid=" . $input->in['bugid']);
}
}
SELECT favorite.bugid, bug.* FROM " . TABLE_PREFIX . "favorite AS favorite
RIGHT JOIN " . TABLE_PREFIX . "bug AS bug
ON (favorite.bugid = bug.bugid)
- WHERE favorite.userid = " . $bugsys->userinfo['userid'] . "
- AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . $bugsys->userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ")
+ WHERE favorite.userid = " . bugdar::$userinfo['userid'] . "
+ AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . bugdar::$userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ")
");
- if ($db->num_rows($favorites) < 1)
+ if ($favorites->size() < 1)
{
$message->error(T('You do not have any favorites in your list. To add a bug to your list, while viewing the report, click the [Add to Favorites] link next to the bug\'s ID.'));
}
$headers = $sort->constructColumnHeaders(false);
- while ($bug = $db->fetch_array($favorites))
+ foreach ($favorites as $bug)
{
- $funct->exec_swap_bg('altcolor', '');
- $bug = ProcessBugDataForDisplay($bug, $funct->bgcolour);
+ BSFunctions::swap_css_classes('altcolor', '');
+ $bug = ProcessBugDataForDisplay($bug, BSFunctions::$cssClass);
$bugs .= $sort->constructRow($bug);
}
- eval('$template->flush("' . $template->fetch('favorites') . '");');
+ $tpl = new BSTemplate('favorites');
+ $tpl->vars = array(
+ 'bugs' => $bugs,
+ 'headers' => $headers
+ );
+ $tpl->evaluate()->flush();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
// initialize template system
-$bugsys->load('template_fs', 'template', true);
-$template->setExtension('tpl');
-$template->setPreParseHook('isso_pre_parse_hook');
-$template->setTemplateDir('templates/');
-$template->setDatabaseCache(TABLE_PREFIX . 'template');
-$template->langcall = 'T';
+require_once ISSO . '/Template.php';
+BSTemplate::$preParseHook = 'isso_pre_parse_hook';
+BSTemplate::$dbCacheTable = TABLE_PREFIX . 'template';
+BSTemplate::$langcall = 'T';
+BSTemplate::$templatePath = 'templates/%s.tpl';
+
+// ###################################################################
+// initialize the email system
+require_once ISSO . '/Mail.php';
+require_once 'includes/emails.php';
+
+define('MAIL_FROM_ADDRESS', bugdar::$options['webmasteremail']);
+define('MAIL_FROM_NAME', bugdar::$options['trackertitle']);
// ###################################################################
// global template variables
-$datetime = $datef->format('l, F j, Y g:i A');
-$year = $datef->format('Y');
-$version = $bugsys->options['trackerversion'];
-$show['admin'] = (bool)can_perform('canadminpanel');
-$show['newreport'] = (bool)can_perform('cansubmitbugs');
-$show['search'] = (bool)can_perform('cansearch');
+$show = array(
+ 'admin' => can_perform('canadminpanel'),
+ 'newreport' => can_perform('cansubmitbugs'),
+ 'search' => can_perform('cansearch')
+);
if (!(defined('NO_TEMPLATES') AND constant('NO_TEMPLATES') == true))
{
$start = microtime();
- $template->cache(array_merge($globaltemplates, (array)$fetchtemplates));
+ BSTemplate::cache(array_merge($globaltemplates, (array)$fetchtemplates));
- $bugsys->debug('time for tpl cache: ' . $funct->fetch_microtime_diff($start));
+ BSApp::debug('time for tpl cache: ' . BSFunctions::fetch_microtime_diff($start));
- eval('$header = "' . $template->fetch('header') . '";');
- eval('$doctype = "' . $template->fetch('doctype') . '";');
- eval('$headinclude = "' . $template->fetch('headinclude') . '";');
- eval('$footer = "' . $template->fetch('footer') . '";');
+ BSTemplate::$globalVars = array(
+ 'stylevar' => &$stylevar,
+ 'show' => &$show,
+ 'focus' => $focus
+ );
+
+ $globalTemplates = array(
+ 'header' => BSTemplate::fetch('header')->evaluate()->getTemplate(),
+ 'doctype' => BSTemplate::fetch('doctype')->evaluate()->getTemplate(),
+ 'headinclude' => BSTemplate::fetch('headinclude')->evaluate()->getTemplate(),
+ 'footer' => BSTemplate::fetch('footer')->evaluate()->getTemplate(),
+ );
+
+ BSTemplate::$globalVars = array_merge($globalTemplates, BSTemplate::$globalVars);
}
-// ###################################################################
-
-// ###################################################################
-// initialize template variables
-$show = array();
-
// ###################################################################
// create error reporter
require_once('./includes/class_message_reporter.php');
$message = new MessageReporter();
-$bugsys->message =& $message;
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'help_window'
);
-define('SVN', '$Id$');
require_once('./global.php');
-if (!$bugsys->in['topic'] OR !isset($bugsys->datastore['help'][ $bugsys->in['topic'] ]))
+if (!$input->in['topic'] OR !isset(bugdar::$datastore['help'][ $input->in['topic'] ]))
{
$topic['title'] = T('Invalid');
$topic['body'] = T('That help topic does not exist in the system.');
}
else
{
- $topic = $bugsys->datastore['help'][ $bugsys->in['topic'] ];
+ $topic = bugdar::$datastore['help'][ $input->in['topic'] ];
$topic['body'] = nl2br($topic['body']);
}
-eval('$template->flush("' . $template->fetch('help_window') . '");');
+$tpl = new BSTemplate('help_window');
+$tpl->vars = array('topic' => $topic);
+$tpl->evaluate()->flush();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
+require_once ISSO . '/Api.php';
/**
-* API: Attachment
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class AttachmentAPI extends API
+ * API: Attachment
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class AttachmentAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'attachmentid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'bugid' => array(TYPE_UINT, REQ_YES, null, array('includes/api_bug.php', 'BugAPI')),
- 'filename' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
+ 'attachmentid' => array(TYPE_UINT, REQ_AUTO),
+ 'bugid' => array(TYPE_UINT, REQ_YES),
+ 'filename' => array(TYPE_STR, REQ_YES),
'mimetype' => array(TYPE_STR, REQ_YES),
'filesize' => array(TYPE_INT, REQ_NO),
'attachment' => array(TYPE_BIN, REQ_YES),
'description' => array(TYPE_STR, REQ_YES),
'dateline' => array(TYPE_UINT, REQ_SET),
- 'userid' => array(TYPE_UINT, REQ_YES, null, array('includes/api_user.php', 'UserAPI')),
+ 'userid' => array(TYPE_UINT, REQ_YES),
'obsolete' => array(TYPE_BOOL, REQ_NO)
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'attachment';
+ * Database table
+ * @var string
+ */
+ protected $table = 'attachment';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Set field: dateline
- *
- * @access private
- */
- function set_dateline()
+ * Set field: dateline
+ */
+ protected function set_dateline()
{
$this->set('dateline', time());
}
+
+ /**
+ * Validate: attachmentid
+ */
+ protected function validate_attachmentid($field)
+ {
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: filename
+ */
+ protected function validate_filename($field)
+ {
+ return $this->_verifyIsNotEmpty($field);
+ }
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
-
+require_once ISSO . '/Api.php';
require_once('./includes/functions_datastore.php');
/**
-* API: Automation
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class AutomationAPI extends API
+ * API: Automation
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class AutomationAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'actionid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'name' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
+ 'actionid' => array(TYPE_UINT, REQ_AUTO),
+ 'name' => array(TYPE_STR, REQ_YES),
'description' => array(TYPE_STR, REQ_NO),
- 'fieldchanges' => array(TYPE_NONE, REQ_YES, ':self'),
+ 'fieldchanges' => array(TYPE_NONE, REQ_YES),
'comment' => array(TYPE_STR, REQ_NO)
);
/**
- * Table
- * @var string
- * @access private
- */
- var $table = 'automation';
+ * Table
+ * @var string
+ */
+ protected $table = 'automation';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Post-insert
- *
- * @access private
- */
- function post_insert()
+ * Post-insert
+ */
+ protected function post_insert()
{
build_automations();
}
- // ###################################################################
/**
- * Post-update
- *
- * @access private
- */
- function post_update()
+ * Post-update
+ */
+ protected function post_update()
{
build_automations();
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access private
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
build_automations();
}
- // ###################################################################
/**
- * Verify: fieldchanges
- *
- * @access private
- */
- function verify_fieldchanges()
+ * Validate: actionid
+ */
+ protected function validate_actionid($field)
{
- if (!is_array($this->values['fieldchanges']) OR sizeof($this->values['fieldchanges']) != 2 OR !is_array($this->values['fieldchanges']['custom']) OR !is_array($this->values['fieldchanges']['builtin']))
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: name
+ */
+ protected function validate_name($field)
+ {
+ return $this->_verifyIsNotEmpty($field);
+ }
+
+ /**
+ * Validate: fieldchanges
+ */
+ protected function validate_fieldchanges()
+ {
+ if (!is_array($this->values['fieldchanges']) || sizeof($this->values['fieldchanges']) != 2 || !is_array($this->values['fieldchanges']['custom']) || !is_array($this->values['fieldchanges']['builtin']))
{
return T('Invalid array type passed. The fieldchaneges array must be a two-dimensional array: array("builtin" => array("fieldname" => "newvalue" ...), "custom" => array("fieldname" => "fieldvalue" ...))');
}
- if (sizeof($this->values['fieldchanges']['custom']) < 1 AND sizeof($this->values['fieldchanges']['builtin']) < 1)
+ if (sizeof($this->values['fieldchanges']['custom']) < 1 && sizeof($this->values['fieldchanges']['builtin']) < 1)
{
return T('You need to specify some fields to change.');
}
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
+require_once ISSO . '/Api.php';
/**
-* API: Bug
-*
-* Note: When priority, severity, status, and resolution should throw a
-* verification error, they actually set it to the default value
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class BugAPI extends API
+ * API: Bug
+ *
+ * Note: When priority, severity, status, and resolution should throw a
+ * verification error, they actually set it to the default value
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class BugAPI extends BSApi
{
/**
- * Database fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'bugid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
+ * Database fields
+ * @var array
+ */
+ protected $fields = array(
+ 'bugid' => array(TYPE_UINT, REQ_AUTO),
'userid' => array(TYPE_UINT, REQ_NO),
'username' => array(TYPE_STR, REQ_NO),
'dateline' => array(TYPE_UINT, REQ_SET),
- 'product' => array(TYPE_UINT, REQ_YES, ':self'),
- 'component' => array(TYPE_UINT, REQ_NO, ':self'),
- 'version' => array(TYPE_UINT, REQ_YES, ':self'),
- 'summary' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
- 'priority' => array(TYPE_UINT, REQ_NO, ':self'),
- 'severity' => array(TYPE_UINT, REQ_NO, ':self'),
- 'status' => array(TYPE_UINT, REQ_NO, ':self'),
- 'resolution' => array(TYPE_UINT, REQ_NO, ':self'),
- 'assignedto' => array(TYPE_UINT, REQ_NO, ':self', array('includes/api_user.php', 'UserAPI')),
+ 'product' => array(TYPE_UINT, REQ_YES),
+ 'component' => array(TYPE_UINT, REQ_NO),
+ 'version' => array(TYPE_UINT, REQ_YES),
+ 'summary' => array(TYPE_STR, REQ_YES),
+ 'priority' => array(TYPE_UINT, REQ_NO),
+ 'severity' => array(TYPE_UINT, REQ_NO),
+ 'status' => array(TYPE_UINT, REQ_NO),
+ 'resolution' => array(TYPE_UINT, REQ_NO),
+ 'assignedto' => array(TYPE_UINT, REQ_NO),
'duplicateof' => array(TYPE_STR, REQ_NO),
'dependency' => array(TYPE_STR, REQ_NO),
'hidden' => array(TYPE_BOOL, REQ_NO),
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'bug';
+ * Database table
+ * @var string
+ */
+ protected $table = 'bug';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Subclassed set() that will intercept any custom fields and handle
- * them appropriately, but everyting else will be passed to the parent.
- */
+ * Subclassed set() that will intercept any custom fields and handle
+ * them appropriately, but everyting else will be passed to the parent.
+ */
function set($field, $value, $doclean = true, $doverify = true)
{
// it's a custom field, so add it in
- if (preg_match('#^custom#', $field) == 1 AND !isset($this->fields["$field"]))
+ if (preg_match('/^custom/', $field) == 1 && !isset($this->fields["$field"]))
{
$this->fields["$field"] = array(TYPE_STR, REQ_NO);
}
parent::set($field, $value, $doclean, $doverify);
}
- // ###################################################################
/**
- * Set field: dateline
- *
- * @access private
- */
- function set_dateline()
+ * Set field: dateline
+ */
+ protected function set_dateline()
{
$this->set('dateline', time());
}
- // ###################################################################
/**
- * Post-insert
- *
- * @access private
- */
- function post_insert()
+ * Post-insert
+ */
+ protected function post_insert()
{
- $this->registry->db->query("INSERT INTO " . TABLE_PREFIX . "vote (bugid, votefor, voteagainst) VALUES (" . $this->insertid . ", 0, 0)");
+ BSApp::$db->query("INSERT INTO " . TABLE_PREFIX . "vote (bugid, votefor, voteagainst) VALUES (" . $this->insertid . ", 0, 0)");
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access private
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "comment WHERE bugid = " . $this->values['bugid']);
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE bugid = " . $this->values['bugid']);
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "history WHERE bugid = " . $this->values['bugid']);
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "vote WHERE bugid = " . $this->values['bugid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "comment WHERE bugid = " . $this->values['bugid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE bugid = " . $this->values['bugid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "history WHERE bugid = " . $this->values['bugid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "vote WHERE bugid = " . $this->values['bugid']);
}
- // ###################################################################
/**
- * Verify: product
- *
- * @access private
- */
- function verify_product()
+ * Verify: product
+ */
+ protected function validate_product($field)
{
- if (!($nozero = $this->verify_nozero('product')))
+ if (!$this->_verifyIsNotZero('product'))
{
- return $nozero;
+ return false;
}
- if (!$this->registry->datastore['product'][ $this->values['product'] ])
+ if (!bugdar::$datastore['product'][$this->values['product']])
{
+ $this->_error(new FieldException(L_INVALID_ID, $field));
return false;
}
+
return true;
}
- // ###################################################################
/**
- * Verify: componentid
- *
- * @access private
- */
- function verify_component()
+ * Verify: componentid
+ */
+ protected function validate_component($field)
{
if ($this->values['component'] != 0)
{
- $component = $this->registry->datastore['component'][ $this->values['component'] ];
- $product = $this->registry->datastore['product'][ $this->values['product'] ];
- $version = $this->registry->datastore['version'][ $this->values['version'] ];
+ $component = bugdar::$datastore['component'][ $this->values['component'] ];
+ $product = bugdar::$datastore['product'][ $this->values['product'] ];
+ $version = bugdar::$datastore['version'][ $this->values['version'] ];
if ($component['parentid'] != $product['productid'])
{
+ $this->_error(new FieldException(L_INVALID_ID, $field));
return false;
}
- if (($version['productid'] != $component['productid'] AND $version['productid'] != $product['productid']) AND $version['productid'] != 0)
+ if (($version['productid'] != $component['productid'] && $version['productid'] != $product['productid']) && $version['productid'] != 0)
{
+ $this->_error(new FieldException(L_INVALID_ID, $field));
return false;
}
}
return true;
}
- // ###################################################################
/**
- * Verify: versionid
- *
- * @access private
- */
- function verify_version()
+ * Verify: versionid
+ */
+ protected function validate_version()
{
- if (!($nozero = $this->verify_nozero('version')))
+ if ($this->_verifyIsNotZero('version'))
{
- return $nozero;
+ return false;
}
- if (!$this->registry->datastore['version'][ $this->values['version'] ])
+ if (!bugdar::$datastore['version'][ $this->values['version'] ])
{
+ $this->_error(new FieldException(L_INVALID_ID, $field));
return false;
}
return true;
}
- // ###################################################################
/**
- * Verify: priority
- *
- * @access private
- */
- function verify_priority()
+ * Verify: priority
+ */
+ protected function validate_priority()
{
- if (!$this->registry->datastore['priority'][ $this->values['priority'] ])
+ if (!bugdar::$datastore['priority'][ $this->values['priority'] ])
{
- $this->set('priority', $this->registry->options['defaultpriority']);
+ $this->set('priority', bugdar::$options['defaultpriority']);
}
return true;
}
- // ###################################################################
/**
- * Verify: severity
- *
- * @access private
- */
- function verify_severity()
+ * Verify: severity
+ *
+ * @access private
+ */
+ protected function validate_severity()
{
- if (!$this->registry->datastore['severity'][ $this->values['severity'] ])
+ if (!bugdar::$datastore['severity'][ $this->values['severity'] ])
{
- $this->set('severity', $this->registry->options['defaultseverity']);
+ $this->set('severity', bugdar::$options['defaultseverity']);
}
return true;
}
- // ###################################################################
/**
- * Verify: status
- *
- * @access private
- */
- function verify_status()
+ * Verify: status
+ */
+ protected function validate_status()
{
- if (!$this->registry->datastore['status'][ $this->values['status'] ])
+ if (!bugdar::$datastore['status'][ $this->values['status'] ])
{
- $this->set('status', $this->registry->options['defaultstatus']);
+ $this->set('status', bugdar::$options['defaultstatus']);
}
return true;
}
- // ###################################################################
/**
- * Verify: resolution
- *
- * @access private
- */
- function verify_resolution()
+ * Verify: resolution
+ */
+ protected function validate_resolution()
{
- if (!$this->registry->datastore['resolution'][ $this->values['resolution'] ])
+ if (!bugdar::$datastore['resolution'][ $this->values['resolution'] ])
{
- $this->set('resolution', $this->registry->options['defaultresolve']);
+ $this->set('resolution', bugdar::$options['defaultresolve']);
}
return true;
}
- // ###################################################################
/**
- * Verify: assignedto
- *
- * @access private
- */
- function verify_assignedto()
+ * Verify: assignedto
+ *
+ * @access private
+ */
+ protected function validate_assignedto()
{
- if (!$this->registry->datastore['assignto'][ $this->values['assignedto'] ] AND $this->values['assignedto'] != 0)
+ if (!bugdar::$datastore['assignto'][ $this->values['assignedto'] ] && $this->values['assignedto'] != 0)
{
- $this->set('assignedto', $this->registry->options['defaultassign']);
+ $this->set('assignedto', bugdar::$options['defaultassign']);
}
return true;
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
+require_once ISSO . '/Api.php';
/**
-* API: Comment
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class CommentAPI extends API
+ * API: Comment
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class CommentAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'commentid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'bugid' => array(TYPE_UINT, REQ_YES, 'verify_nozero'),
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
+ 'commentid' => array(TYPE_UINT, REQ_AUTO),
+ 'bugid' => array(TYPE_UINT, REQ_YES),
'userid' => array(TYPE_UINT, REQ_NO),
'dateline' => array(TYPE_UINT, REQ_SET),
'parselinks' => array(TYPE_BOOL, REQ_NO),
- 'comment' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ 'comment' => array(TYPE_STR, REQ_YES),
'comment_parsed' => array(TYPE_NONE, REQ_SET),
'hidden' => array(TYPE_BOOL, REQ_NO)
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'comment';
+ * Database table
+ * @var string
+ */
+ protected $table = 'comment';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Set field: dateline
- *
- * @access private
- */
- function set_dateline()
+ * Set field: dateline
+ */
+ protected function set_dateline()
{
$this->set('dateline', time());
}
- // ###################################################################
/**
- * Set field: comment_parsed
- *
- * @access private
- */
- function set_comment_parsed()
+ * Set field: comment_parsed
+ */
+ protected function set_comment_parsed()
{
$comment = $this->values['comment'];
if ($this->values['parselinks'])
$comment = preg_replace('#(https?://|www\.)\S+#i', '<a href="\0">\0</a>', $comment);
}
- if ($this->registry->options['allowhtml'])
+ if (bugdar::$options['allowhtml'])
{
- $this->set('comment_parsed', nl2br($this->registry->unsanitize($comment)));
+ $this->set('comment_parsed', nl2br(BSApp::$input->unsanitize($comment)));
}
else
{
}
}
- // ###################################################################
/**
- * Pre-update
- *
- * @access private
- */
- function pre_update()
+ * Pre-update
+ */
+ protected function pre_update()
{
$this->set_comment_parsed();
}
- // ###################################################################
/**
- * Pre-delete
- *
- * @access private
- */
- function pre_delete()
+ * Pre-delete
+ */
+ protected function pre_delete()
{
- if ($this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE initialreport = " . $this->values['commentid']))
+ if (BSApp::$db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE initialreport = " . $this->values['commentid']))
{
$this->error(T('You cannot delete this comment because it is attached to the bug as the first comment. You have to delete the entire bug instead (which is not recommended unless it is spam).'));
}
}
+
+ /**
+ * Validate: commentid
+ */
+ protected function validate_commentid($field)
+ {
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: Bug ID
+ */
+ protected function validate_bugid($field)
+ {
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: comment
+ */
+ protected function validate_comment($field)
+ {
+ return $this->_verifyIsNotEmpty($field);
+ }
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
-
+require_once ISSO . '/Api.php';
require_once('./includes/functions_datastore.php');
/**
-* API: Field
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class FieldAPI extends API
+ * API: Field
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class FieldAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'fieldid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'name' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
+ 'fieldid' => array(TYPE_UINT, REQ_AUTO),
+ 'name' => array(TYPE_STR, REQ_YES),
'description' => array(TYPE_STR, REQ_NO),
- 'type' => array(TYPE_STR, REQ_YES, ':self'),
- 'selects' => array(TYPE_STR, REQ_NO, ':self'),
+ 'type' => array(TYPE_STR, REQ_YES),
+ 'selects' => array(TYPE_STR, REQ_NO),
'required' => array(TYPE_BOOL, REQ_NO),
'cansearch' => array(TYPE_BOOL, REQ_NO),
'regexmatch' => array(TYPE_STR, REQ_NO),
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'bugfield';
+ * Database table
+ * @var string
+ */
+ protected $table = 'bugfield';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * A static method that is used to return an array of all the allowed
- * field types.
- *
- * @access public
- *
- * @param string Return the display name of a type if the key is passed
- *
- * @return array An array of all the allowed field types
- */
- function field_types($type = null)
+ * A static method that is used to return an array of all the allowed
+ * field types.
+ *
+ * @param string Return the display name of a type if the key is passed
+ *
+ * @return array An array of all the allowed field types
+ */
+ public static function field_types($type = null)
{
- global $lang;
$types = array(
'input_text' => T('Single-Line Text Box'),
'input_checkbox' => T('Checkbox Flag'),
}
}
- // ###################################################################
/**
- * Post-insert
- *
- * @access private
- */
- function post_insert()
+ * Post-insert
+ */
+ protected function post_insert()
{
build_user_help();
}
- // ###################################################################
/**
- * Post-update
- *
- * @access private
- */
- function post_update()
+ * Post-update
+ */
+ protected function post_update()
{
build_user_help();
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access private
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "bugfield WHERE fieldid = " . $this->values['fieldid']);
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "bugfieldpermission WHERE fieldid = " . $this->values['fieldid']);
- $this->registry->db->query("ALTER TABLE " . TABLE_PREFIX . "bug DROP custom" . $this->values['fieldid']);
- $this->registry->db->query("OPTIMIZE TABLE " . TABLE_PREFIX . "bug");
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "bugfield WHERE fieldid = " . $this->values['fieldid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "bugfieldpermission WHERE fieldid = " . $this->values['fieldid']);
+ BSApp::$db->query("ALTER TABLE " . TABLE_PREFIX . "bug DROP custom" . $this->values['fieldid']);
+ BSApp::$db->query("OPTIMIZE TABLE " . TABLE_PREFIX . "bug");
build_user_help();
}
- // ###################################################################
/**
- * Verify: type
- *
- * @access private
- */
- function verify_type()
+ * Validate: fieldid
+ */
+ protected function validate_fieldid($field)
{
- if (!in_array($this->values['type'], array_keys(FieldAPI::field_types())))
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: name
+ */
+ protected function validate_name($field)
+ {
+ return $this->_verifyIsNotEmpty($field);
+ }
+
+ /**
+ * Validate: type
+ */
+ protected function validate_type()
+ {
+ if (!in_array($this->values['type'], array_keys(self::field_types())))
{
return false;
}
return true;
}
- // ###################################################################
/**
- * Verify: selects
- *
- * @access private
- */
- function verify_selects()
+ * Validate: selects
+ */
+ protected function validate_selects()
{
static $serialized;
- if ($this->values['type'] == 'select_single' OR $this->objdata['type'] == 'select_single')
+ if ($this->values['type'] == 'select_single' || $this->record['type'] == 'select_single')
{
- $this->registry->debug('it works');
+ BSApp::debug('it works');
// can't use explode() here because explode() returns !empty() when splitting an empty string
// so we have to use preg_split with the PREG_SPLIT_NO_EMPTY flag to prevent this
$selects = preg_split("#\n#", trim($this->values['selects']), 0, PREG_SPLIT_NO_EMPTY);
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
-
+require_once ISSO . '/Api.php';
require_once('./includes/functions_datastore.php');
/**
-* API: Language
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class LanguageAPI extends API
+ * API: Language
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class LanguageAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'languageid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'title' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
+ 'languageid' => array(TYPE_UINT, REQ_AUTO),
+ 'title' => array(TYPE_STR, REQ_YES),
'charset' => array(TYPE_STR, REQ_YES),
- 'direction' => array(TYPE_STR, REQ_NO, ':self'),
+ 'direction' => array(TYPE_STR, REQ_NO),
'userselect' => array(TYPE_BOOL, REQ_NO),
'langcode' => array(TYPE_STR, REQ_YES)
);
/**
- * Table
- * @var string
- * @access private
- */
- var $table = 'language';
+ * Table
+ * @var string
+ */
+ protected $table = 'language';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Post-insert
- *
- * @access private
- */
- function post_insert()
+ * Post-insert
+ */
+ protected function post_insert()
{
build_languages();
}
- // ###################################################################
/**
- * Post-update
- *
- * @access private
- */
- function post_update()
+ * Post-update
+ */
+ protected function post_update()
{
build_languages();
}
- // ###################################################################
/**
- * Pre-delete
- */
- function pre_delete()
+ * Pre-delete
+ */
+ protected function pre_delete()
{
- $count = $this->registry->db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "language");
+ $count = BSApp::$db->queryFirst("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "language");
if ($count['count'] < 2)
{
- $this->error(T('At least one language needs to be present. Deleting this language would violate that.'));
+ throw new FieldException(T('At least one language needs to be present. Deleting this language would violate that.'), 'languageid');
}
- if ($this->registry->options['defaultlanguage'] == $this->values['languageid'])
+ if (bugdar::$options['defaultlanguage'] == $this->values['languageid'])
{
- $this->error(T('You cannot delete the default language. Please select another language to be the default language and then delete this one.'));
+ throw new FieldException(T('You cannot delete the default language. Please select another language to be the default language and then delete this one.'), 'languageid');
}
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access private
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
build_languages();
}
- // ###################################################################
/**
- * Verify: direction
- *
- * @access private
- */
- function verify_direction()
+ * Verify: direction
+ */
+ protected function validate_direction($field)
{
if (!in_array($this->values['direction'], array('ltr', 'rtl')))
{
- return T('The direction must be ltr (left-to-right) or rtl (right-to-left)');
+ $this->_error(new FieldError(T('The direction must be ltr (left-to-right) or rtl (right-to-left)'), $field));
+ return false;
}
return true;
}
+
+ /**
+ * Validate: languageid
+ */
+ protected function validate_languageid($field)
+ {
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: title
+ */
+ protected function validate_title($field)
+ {
+ return $this->_verifyIsNotEmpty($field);
+ }
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
-
+require_once ISSO . '/Api.php';
require_once('./includes/functions_datastore.php');
/**
-* API: Priority
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class PriorityAPI extends API
+ * API: Priority
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class PriorityAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'priorityid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'priority' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
+ 'priorityid' => array(TYPE_UINT, REQ_AUTO),
+ 'priority' => array(TYPE_STR, REQ_YES),
'displayorder' => array(TYPE_INT, REQ_NO)
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'priority';
+ * Database table
+ * @var string
+ */
+ protected $table = 'priority';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Post-insert
- *
- * @access protected
- */
- function post_insert()
+ * Post-insert
+ */
+ protected function post_insert()
{
build_priorities();
}
- // ###################################################################
/**
- * Post-update
- *
- * @access protected
- */
- function post_update()
+ * Post-update
+ */
+ protected function post_update()
{
build_priorities();
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access protected
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
build_priorities();
- $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET priority = " . $this->registry->options['defaultpriority'] . " WHERE priority = " . $this->values['priorityid']);
+ BSApp::$db->query("UPDATE " . TABLE_PREFIX . "bug SET priority = " . bugdar::$options['defaultpriority'] . " WHERE priority = " . $this->values['priorityid']);
+ }
+
+ /**
+ * Validate: priorityid
+ */
+ protected function validate_priorityid($field)
+ {
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: priority
+ */
+ protected function validate_priority($field)
+ {
+ return $this->_verifyIsNotEmpty($field);
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
-
+require_once ISSO . '/Api.php';
require_once('./includes/functions_datastore.php');
/**
-* API: Resolution
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class ResolutionAPI extends API
+ * API: Resolution
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class ResolutionAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'resolutionid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'resolution' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
+ 'resolutionid' => array(TYPE_UINT, REQ_AUTO),
+ 'resolution' => array(TYPE_STR, REQ_YES),
'displayorder' => array(TYPE_INT, REQ_NO)
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'resolution';
+ * Database table
+ * @var string
+ */
+ protected $table = 'resolution';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Post-insert
- *
- * @access protected
- */
- function post_insert()
+ * Post-insert
+ */
+ protected function post_insert()
{
build_resolutions();
}
- // ###################################################################
/**
- * Post-update
- *
- * @access protected
- */
- function post_update()
+ * Post-update
+ */
+ protected function post_update()
{
build_resolutions();
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access protected
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
build_resolutions();
- $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET resolution = " . $this->registry->clean($this->registry->options['defaultresolve'], TYPE_UINT) . " WHERE resolution = " . $this->values['resolutionid']);
+ BSApp::$db->query("UPDATE " . TABLE_PREFIX . "bug SET resolution = " . BSApp::$input->clean(bugdar::$options['defaultresolve'], TYPE_UINT) . " WHERE resolution = " . $this->values['resolutionid']);
+ }
+
+ /**
+ * Validate: resolutionid
+ */
+ protected function validate_resolutionid($field)
+ {
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: resolution
+ */
+ protected function validate_resolution($field)
+ {
+ return $this->_verifyIsNotEmpty($field);
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
+require_once ISSO . '/Api.php';
require_once('./includes/functions_datastore.php');
/**
-* API: Severity
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class SeverityAPI extends API
+ * API: Severity
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class SeverityAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'severityid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'severity' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
+ 'severityid' => array(TYPE_UINT, REQ_AUTO),
+ 'severity' => array(TYPE_STR, REQ_YES),
'displayorder' => array(TYPE_INT, REQ_NO)
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'severity';
+ * Database table
+ * @var string
+ */
+ protected $table = 'severity';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Post-insert
- *
- * @access protected
- */
- function post_insert()
+ * Post-insert
+ */
+ protected function post_insert()
{
build_severities();
}
- // ###################################################################
/**
- * Post-update
- *
- * @access protected
- */
- function post_update()
+ * Post-update
+ */
+ protected function post_update()
{
build_severities();
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access protected
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
build_severities();
- $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET severity = " . $this->registry->options['defaultseverity'] . " WHERE severity = " . $this->values['severityid']);
+ BSApp::$db->query("UPDATE " . TABLE_PREFIX . "bug SET severity = " . bugdar::$options['defaultseverity'] . " WHERE severity = " . $this->values['severityid']);
+ }
+
+ /**
+ * Validate: severityid
+ */
+ protected function validate_statusid($field)
+ {
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: severity
+ */
+ protected function validate_status($field)
+ {
+ return $this->_verifyIsNotEmpty($field);
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
+require_once ISSO . '/Api.php';
require_once('./includes/functions_datastore.php');
/**
-* API: Status
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class StatusAPI extends API
+ * API: Status
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class StatusAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'statusid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'status' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
+ 'statusid' => array(TYPE_UINT, REQ_AUTO),
+ 'status' => array(TYPE_STR, REQ_YES),
'color' => array(TYPE_STR, REQ_NO),
'displayorder' => array(TYPE_INT, REQ_NO)
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'status';
+ * Database table
+ * @var string
+ */
+ protected $table = 'status';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Post-insert
- *
- * @access protected
- */
+ * Post-insert
+ */
function post_insert()
{
build_statuses();
}
- // ###################################################################
/**
- * Post-update
- *
- * @access protected
- */
- function post_update()
+ * Post-update
+ */
+ protected function post_update()
{
build_statuses();
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access protected
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
build_statuses();
- $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET status = " . $this->registry->options['defaultstatus'] . " WHERE status = " . $this->values['statusid']);
+ BSApp::$db->query("UPDATE " . TABLE_PREFIX . "bug SET status = " . bugdar::$options['defaultstatus'] . " WHERE status = " . $this->values['statusid']);
+ }
+
+ /**
+ * Validate: statusid
+ */
+ protected function validate_statusid($field)
+ {
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: status
+ */
+ protected function validate_status($field)
+ {
+ return $this->_verifyIsNotEmpty($field);
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
-
+require_once ISSO . '/Api.php';
require_once('./includes/functions_datastore.php');
require_once('./includes/class_sort.php');
/**
-* API: User
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class UserAPI extends API
+ * API: User
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class UserAPI extends BSApi
{
/**
- * Database fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'userid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'email' => array(TYPE_STR, REQ_YES, ':self'),
- 'displayname' => array(TYPE_STR, REQ_YES, ':self'),
- 'usergroupid' => array(TYPE_UINT, REQ_YES, ':self'),
- 'groupids' => array(TYPE_STR, REQ_NO, ':self'),
+ * Database fields
+ * @var array
+ */
+ protected $fields = array(
+ 'userid' => array(TYPE_UINT, REQ_AUTO),
+ 'email' => array(TYPE_STR, REQ_YES),
+ 'displayname' => array(TYPE_STR, REQ_YES),
+ 'usergroupid' => array(TYPE_UINT, REQ_YES),
+ 'groupids' => array(TYPE_STR, REQ_NO),
'password' => array(TYPE_STR, REQ_YES),
'salt' => array(TYPE_STR, REQ_SET),
'authkey' => array(TYPE_STR, REQ_SET),
'languageid' => array(TYPE_UINT, REQ_NO),
'timezone' => array(TYPE_FLOAT,REQ_NO),
'usedst' => array(TYPE_BOOL, REQ_NO),
- 'hidestatuses' => array(TYPE_STR, REQ_NO, ':self'),
- 'defaultsortkey' => array(TYPE_STR, REQ_NO, ':self'),
- 'defaultsortas' => array(TYPE_STR, REQ_NO, ':self'),
- 'columnoptions' => array(TYPE_STR, REQ_NO, ':self'),
+ 'hidestatuses' => array(TYPE_STR, REQ_NO),
+ 'defaultsortkey' => array(TYPE_STR, REQ_NO),
+ 'defaultsortas' => array(TYPE_STR, REQ_NO),
+ 'columnoptions' => array(TYPE_STR, REQ_NO),
'authid' => array(TYPE_STR, REQ_NO)
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'user';
+ * Database table
+ * @var string
+ */
+ protected $table = 'user';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Set field: salt
- *
- * @access private
- */
- function set_salt()
+ * Set field: salt
+ */
+ protected function set_salt()
{
- $this->set('salt', $this->registry->funct->rand(array(1, 15)));
+ $this->set('salt', BSFunctions::random(rand(3, 15)));
}
- // ###################################################################
/**
- * Set field: authkey
- *
- * @access private
- */
- function set_authkey()
+ * Set field: authkey
+ */
+ protected function set_authkey()
{
- $this->set('authkey', $this->registry->funct->rand());
+ $this->set('authkey', BSFunctions::random());
}
- // ###################################################################
/**
- * Pre-insert
- *
- * @access private
- */
- function pre_insert()
+ * Pre-insert
+ */
+ protected function pre_insert()
{
$this->set('password', md5(md5($this->values['password']) . md5($this->values['salt'])));
}
- // ###################################################################
/**
- * Post-insert
- *
- * @access protected
- */
- function post_insert()
+ * Post-insert
+ */
+ protected function post_insert()
{
- $this->registry->db->query("
+ BSApp::$db->query("
INSERT INTO " . TABLE_PREFIX . "useremail
(userid, mask, relation)
VALUES
build_assignedto();
}
- // ###################################################################
/**
- * Verify: email
- *
- * @access private
- */
- function verify_email()
+ * Validate: email
+ */
+ protected function validate_email($field)
{
- if (!is_bool($ne = $this->verify_noempty('email')))
+ if (!$this->_verifyIsNotEmpty($field))
{
- return $ne;
+ return false;
}
- if (!$this->registry->funct->is_valid_email($this->values['email']))
+ if (!BSFunctions::is_valid_email($this->values['email']))
{
- return T('The specified email is invalid.');
+ $this->_error(new FieldException(T('The specified email is invalid.'), 'email'));
+ return false;
}
- if ($this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE email = '" . $this->registry->db->escape_string($this->values['email']) . "' AND userid <> " . $this->registry->clean($this->values['userid'], TYPE_UINT)))
+ if (BSApp::$db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE email = '" . BSApp::$input->escape($this->values['email']) . "' AND userid <> " . BSApp::$input->clean($this->values['userid'], TYPE_UINT)))
{
- return T('The specified email is already in use.');
+ $this->_error(new FieldException(T('The specified email is already in use.'), 'email'));
+ return false;
}
return true;
}
- // ###################################################################
/**
- * Verify: displayname
- *
- * @access private
- */
- function verify_displayname()
+ * Validate: displayname
+ */
+ protected function validate_displayname($field)
{
- if (!is_bool($ne = $this->verify_noempty('displayname')))
+ if (!$this->_verifyIsNotEmpty($field))
{
- return $ne;
+ return false;
}
- if ($this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE displayname = '" . $this->registry->db->escape_string($this->values['displayname']) . "' AND userid <> " . $this->registry->clean($this->values['userid'], TYPE_UINT)))
+ if (BSApp::$db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE displayname = '" . BSApp::$input->escape($this->values['displayname']) . "' AND userid <> " . BSApp::$input->clean($this->values['userid'], TYPE_UINT)))
{
- return T('That display name is already in use by another user.');
+ $this->_error(new FieldException(T('That display name is already in use by another user.'), 'displayname'));
+ return false;
}
return true;
}
- // ###################################################################
/**
- * Verify: usergroupid
- *
- * @access private
- */
- function verify_usergroupid()
+ * Validate: usergroupid
+ */
+ protected function validate_usergroupid($field)
{
- if (!isset($this->registry->datastore['usergroup'][ $this->values['usergroupid'] ]))
+ if (!isset(bugdar::$datastore['usergroup'][ $this->values['usergroupid'] ]))
{
+ $this->_error(new FieldException(L_INVALID_ID, $field));
return false;
}
return true;
}
- // ###################################################################
/**
- * Verify: groupids
- *
- * @access private
- */
- function verify_groupids()
+ * Validate: groupids
+ */
+ protected function validate_groupids($field)
{
$groups = $this->values['groupids'];
if (!is_array($groups))
{
$groups = explode(',', $this->values['groupids']);
}
- $groups = $this->registry->funct->array_strip_empty($groups);
+ $groups = BSFunctions::array_strip_empty($groups);
- foreach ($groups AS $group)
+ foreach ($groups as $group)
{
- if (!isset($this->registry->datastore['usergroup']["$group"]))
+ if (!isset(bugdar::$datastore['usergroup']["$group"]))
{
+ $this->_error(new FieldException(L_INVALID_ID, $field));
return false;
}
}
return true;
}
- // ###################################################################
/**
- * Pre-update
- *
- * @access private
- */
- function pre_update()
+ * Pre-update
+ */
+ protected function pre_update()
{
- $this->set_condition();
+ $this->setCondition();
$this->fetch();
if ($this->values['password'] == '')
{
- $this->set('password', $this->objdata['password']);
+ $this->set('password', $this->record['password']);
}
else
{
- $this->registry->debug("updating password = true");
- $this->set('password', md5(md5($this->values['password']) . md5($this->objdata['salt'])));
+ BSApp::debug("updating password = true");
+ $this->set('password', md5(md5($this->values['password']) . md5($this->record['salt'])));
}
}
- // ###################################################################
/**
- * Post-update
- *
- * @access protected
- */
- function post_update()
+ * Post-update
+ */
+ protected function post_update()
{
if (isset($this->values['displayname']))
{
- $username = $this->registry->escape($this->values['displayname']);
+ $username = BSApp::$input->escape($this->values['displayname']);
$id = $this->values['userid'];
- $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET username = '$username' WHERE userid = $id");
- $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET lastpostbyname = '$username' WHERE lastpostby = $id");
- $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET hiddenlastpostbyname = '$username' WHERE hiddenlastpostby = $id");
+ BSApp::$db->query("UPDATE " . TABLE_PREFIX . "bug SET username = '$username' WHERE userid = $id");
+ BSApp::$db->query("UPDATE " . TABLE_PREFIX . "bug SET lastpostbyname = '$username' WHERE lastpostby = $id");
+ BSApp::$db->query("UPDATE " . TABLE_PREFIX . "bug SET hiddenlastpostbyname = '$username' WHERE hiddenlastpostby = $id");
}
- if (isset($this->values['displayname']) OR isset($this->values['email']))
+ if (isset($this->values['displayname']) || isset($this->values['email']))
{
build_assignedto();
}
}
- // ###################################################################
/**
- * Pre-delete
- *
- * @access protected
- */
- function pre_delete()
+ * Pre-delete
+ */
+ protected function pre_delete()
{
- if ($this->values['userid'] == $this->registry->userinfo['userid'])
+ if ($this->values['userid'] == bugdar::$userinfo['userid'])
{
+
$this->error(T('You cannot delete your own account!'));
}
if ($this->values['usergroupid'] == 6)
{
- $count = $this->registry->db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user WHERE usergroupid = 6 AND userid <> " . $this->values['userid']);
+ $count = BSApp::$db->queryFirst("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user WHERE usergroupid = 6 AND userid <> " . $this->values['userid']);
if ($count['count'] < 1)
{
$this->error(T('At least one other administrator needs to be present before you can delete this user'));
}
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access protected
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "user WHERE userid = " . $this->values['userid']);
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $this->values['userid']);
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $this->values['userid']);
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $this->values['userid']);
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE userid = " . $this->values['userid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "user WHERE userid = " . $this->values['userid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $this->values['userid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $this->values['userid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $this->values['userid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE userid = " . $this->values['userid']);
build_assignedto();
}
- // ###################################################################
/**
- * Verify: hidestatuses
- *
- * @access private
- */
- function verify_hidestatuses()
+ * Validate: hidestatuses
+ */
+ protected function validate_hidestatuses($field)
{
if (is_array($this->values['hidestatuses']))
{
return true;
}
- // ###################################################################
/**
- * Verify: defaultsortkey
- *
- * @access private
- */
- function verify_defaultsortkey()
+ * Validate: defaultsortkey
+ */
+ protected function validate_defaultsortkey($field)
{
if (!ListSorter::fetch_by_text($this->values['defaultsortkey']))
{
+ $this->_error(new FieldException(L_INVALID_ID, $field));
return false;
}
return true;
}
- // ###################################################################
/**
- * Verify: defaultsortas
- *
- * @access private
- */
- function verify_defaultsortas()
+ * Validate: defaultsortas
+ */
+ protected function validate_defaultsortas($field)
{
if (!ListSorter::fetch_as_text($this->values['defaultsortas']))
{
+ $this->_error(new FieldException(L_INVALID_ID, $field));
return false;
}
return true;
}
- // ###################################################################
/**
- * Verify: columnoptions
- *
- * @access private
- */
- function verify_columnoptions()
+ * Validate: columnoptions
+ */
+ protected function validate_columnoptions($field)
{
if (is_array($this->values['columnoptions']))
{
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
-
+require_once ISSO . '/Api.php';
require_once('./includes/functions_datastore.php');
/**
-* API: Usergroup
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class UsergroupAPI extends API
+ * API: Usergroup
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class UsergroupAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'usergroupid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'title' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
+ 'usergroupid' => array(TYPE_UINT, REQ_AUTO),
+ 'title' => array(TYPE_STR, REQ_YES),
'displaytitle' => array(TYPE_STR, REQ_NO),
'permissions' => array(TYPE_UINT, REQ_NO)
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'usergroup';
+ * Database table
+ * @var string
+ */
+ protected $table = 'usergroup';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Post-insert
- *
- * @access private
- */
- function post_insert()
+ * Post-insert
+ */
+ protected function post_insert()
{
build_usergroups();
}
- // ###################################################################
/**
- * Post-update
- *
- * @access private
- */
- function post_update()
+ * Post-update
+ */
+ protected function post_update()
{
build_usergroups();
build_assignedto();
}
- // ###################################################################
/**
- * Pre-delete
- *
- * @access private
- */
- function pre_delete()
+ * Pre-delete
+ */
+ protected function pre_delete()
{
if ($this->values['usergroupid'] < 7)
{
- return T('You can\'t delete a default usergroup.');
+ throw new FieldException(T('You can\'t delete a default usergroup.'), 'usergroupid');
+ return false;
}
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access private
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $this->values['usergroupid']);
- $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "bugfieldpermission WHERE usergroupid = " . $this->values['usergroupid']);
- $this->registry->db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = 2 WHERE usergroupid = " . $this->values['usergroupid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $this->values['usergroupid']);
+ BSApp::$db->query("DELETE FROM " . TABLE_PREFIX . "bugfieldpermission WHERE usergroupid = " . $this->values['usergroupid']);
+ BSApp::$db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = 2 WHERE usergroupid = " . $this->values['usergroupid']);
build_usergroups();
build_permissions();
build_assignedto();
}
+
+ /**
+ * Validate: usergroupid
+ */
+ protected function validate_usergroupid($field)
+ {
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: usergroup
+ */
+ protected function validate_usergroup($field)
+ {
+ return $this->_verifyIsNotEmpty($field);
+ }
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
+require_once ISSO . '/Api.php';
require_once('./includes/functions_datastore.php');
/**
-* API: User help
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class UserHelpAPI extends API
+ * API: User help
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class UserHelpAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
'keystring' => array(TYPE_STR, REQ_AUTO),
- 'title' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ 'title' => array(TYPE_STR, REQ_YES),
'body' => array(TYPE_STR, REQ_YES)
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'fieldhelp';
+ * Database table
+ * @var string
+ */
+ protected $table = 'fieldhelp';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * A static function that returns an array of all the keystrings that
- * are not allowed to be deleted
- *
- * @access public
- *
- * @return array Array of keystrings
- */
- function not_able_to_delete()
+ * A static function that returns an array of all the keystrings that
+ * are not allowed to be deleted
+ *
+ * @return array Array of keystrings
+ */
+ public static function not_able_to_delete()
{
return array(
'assignedto',
);
}
- // ###################################################################
/**
- * Pre-insert
- *
- * @access private
- */
- function pre_insert()
- {
- if (($err = $this->verify_keystring()) !== true)
- {
- $this->error($err);
- }
- }
-
- // ###################################################################
- /**
- * Post-insert
- *
- * @access private
- */
- function post_insert()
+ * Post-insert
+ */
+ protected function post_insert()
{
build_user_help();
}
- // ###################################################################
/**
- * Post-update
- *
- * @access private
- */
- function post_update()
+ * Post-update
+ */
+ protected function post_update()
{
build_user_help();
}
- // ###################################################################
/**
- * Pre-delete
- *
- * @access private
- */
- function pre_delete()
+ * Pre-delete
+ */
+ protected function pre_delete()
{
- if (in_array($this->values['keystring'], UserHelpAPI::not_able_to_delete()))
+ if (in_array($this->values['keystring'], self::not_able_to_delete()))
{
- return false;
+ throw new FieldException(T('You cannot delete this user help text because the system needs it.'), 'keystring');
}
- return true;
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access private
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
build_user_help();
}
- // ###################################################################
/**
- * Verify: keystring
- *
- * @access private
- */
- function verify_keystring()
+ * Validate: title
+ */
+ protected function validate_title($field)
{
- if (!is_bool($ne = $this->verify_noempty('keystring')))
+ return $this->_verifyIsNotEmpty($field);
+ }
+
+ /**
+ * Verify: keystring
+ */
+ protected function validate_keystring($field)
+ {
+ if ($this->_verifyIsNotEmpty('keystring'))
{
- return $ne;
+ return false;
}
if (preg_match('#[^a-z0-9_]#', $this->values['keystring']))
{
- return T('The unique key can only contain lowercase letters, underscores, and numbers.');
+ $this->_error(new FieldException(T('The unique key can only contain lowercase letters, underscores, and numbers.'), $field));
+ return false;
}
- if ($this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = '" . $this->registry->escape($this->values['keystring']) . "'"))
+ if (BSApp::$db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = '" . BSApp::$input->escape($this->values['keystring']) . "'"))
{
- return T('The unique key must be unique.');
+ $this->_error(new FieldException(T('The unique key must be unique.'), $field));
+ return false;
}
return true;
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
*/
var $db;
- /**
- * The Bugdar registry
- * @var object
- */
- var $registry;
-
/**
* Array of user data from the AUTHENTICATION database
* @var array
*/
function __construct()
{
- global $bugsys;
-
- $this->registry =& $bugsys;
- $this->db =& $bugsys->db;
+ $this->db = BSApp::$db;
- $this->registry->debug('authentication system: ' . get_class($this));
+ BSApp::debug('authentication system: ' . get_class($this));
$this->_setupDatabase();
}
*/
function _fetchBugdarUserFromAuthUser()
{
- $user = $this->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE authid = '" . $this->authUser[ $this->fieldMap['authid'] ] . "'");
+ $user = $this->db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE authid = '" . $this->authUser[ $this->fieldMap['authid'] ] . "'");
if (!$user)
{
return $this->_createBugdarUser();
$user = new UserAPI($this->registry);
// if the email already exists in the DB, it must be the same person so just hook up the authid
- if ($check = $this->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE email = '" . $this->db->escape_string($this->authUser[ $this->fieldMap['email'] ]) . "'"))
+ if ($check = $this->db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE email = '" . $this->db->escape_string($this->authUser[ $this->fieldMap['email'] ]) . "'"))
{
$user->set('userid', $check['userid']);
$user->set_condition();
$user->update();
$user->fetch();
- return $user->objdata;
+ return $user->record;
}
else
{
function _setCookies($permanent = false) {}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
function _setupDatabase()
{
- $this->authDb =& $this->db;
+ $this->authDb = $this->db;
}
// ###################################################################
function _fetchCookieUniqueId()
{
- return $this->registry->input_clean(COOKIE_PREFIX . 'userid', TYPE_UINT);
+ return BSApp::$input->inputClean(COOKIE_PREFIX . 'userid', TYPE_UINT);
}
// ###################################################################
function _fetchCookiePassword()
{
- return $this->registry->in[COOKIE_PREFIX . 'authkey'];
+ return BSApp::$input->in[COOKIE_PREFIX . 'authkey'];
}
// ###################################################################
function _fetchUserUsingCookies()
{
- return $this->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $this->_fetchCookieUniqueId());
+ return $this->db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $this->_fetchCookieUniqueId());
}
// ###################################################################
// ###################################################################
function _setCookies($sticky = false)
{
- $this->registry->funct->cookie(COOKIE_PREFIX . 'userid', $this->authUser['userid'], $sticky);
- $this->registry->funct->cookie(COOKIE_PREFIX . 'authkey', $this->authUser['authkey'], $sticky);
+ BSFunctions::cookie(COOKIE_PREFIX . 'userid', $this->authUser['userid'], $sticky);
+ BSFunctions::cookie(COOKIE_PREFIX . 'authkey', $this->authUser['authkey'], $sticky);
}
// ###################################################################
function clearCookies()
{
- $this->registry->funct->cookie(COOKIE_PREFIX . 'userid');
- $this->registry->funct->cookie(COOKIE_PREFIX . 'authkey');
+ BSFunctions::cookie(COOKIE_PREFIX . 'userid', false);
+ BSFunctions::cookie(COOKIE_PREFIX . 'authkey', false);
}
// ###################################################################
// ###################################################################
function _fetchUserWithIdentifier($email)
{
- return $this->authDb->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE email = '" . $this->authDb->escape_string($email) . "'");
+ return $this->authDb->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE email = '" . $this->authDb->escapeString($email) . "'");
}
// ###################################################################
function _syncBugdarUser() {}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
-?>
+?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
$this->cookieName = ($this->cookieName == null ? session_name() : $this->cookieName);
// connect to the DB
- $this->authDb = new DB_MySQL($this->registry);
- $this->authDb->connect('DRUPAL_DATABASE_SERVER', 'DATABASE_USER', 'DATABASE_PASSWORD', 'DATABASE_NAME', false);
+ $this->authDb = new BSDbMySQLI();
+ $this->authDb->connect('DRUPAL_DATABASE_SERVER', 'DATABASE_USER', 'DATABASE_PASSWORD', 'DATABASE_NAME');
}
// ###################################################################
function _fetchCookieUniqueId()
{
- return $this->registry->in[ $this->cookieName ];
+ return BSApp::$input->in[$this->cookieName];
}
// ###################################################################
// ###################################################################
function _fetchUserUsingCookies()
{
- $session = $this->authDb->query_first("SELECT * FROM sessions WHERE sid = '" . $this->authDb->escape_string($this->_fetchCookieUniqueId()) . "'");
+ $session = $this->authDb->queryFirst("SELECT * FROM sessions WHERE sid = '" . $this->authDb->escapeString($this->_fetchCookieUniqueId()) . "'");
if (!$session OR $session['uid'] == 0)
{
return false;
}
- return $this->authDb->query_first("SELECT * FROM users WHERE uid = " . $session['uid']);
+ return $this->authDb->queryFirst("SELECT * FROM users WHERE uid = " . $session['uid']);
}
// ###################################################################
// ###################################################################
function _fetchUserWithIdentifier($string)
{
- return $this->authDb->query_first("SELECT * FROM users WHERE name = '" . $this->authDb->escape_string($string) . "'");
+ return $this->authDb->queryFirst("SELECT * FROM users WHERE name = '" . $this->authDb->escapeString($string) . "'");
}
// ###################################################################
// ###################################################################
function clearCookies()
{
- $this->registry->funct->cookie($this->cookieName);
- $this->authDb->query("DELETE FROM sessions WHERE sid = '" . $this->authDb->escape_string($this->_fetchCookieUniqueId()) . "'");
+ BSFunctions::cookie($this->cookieName);
+ $this->authDb->query("DELETE FROM sessions WHERE sid = '" . $this->authDb->escapeString($this->_fetchCookieUniqueId()) . "'");
}
// ###################################################################
{
$sid = $this->_fetchCookieUniqueId();
$sid = ($sid ? $sid : md5(microtime() . rand()));
- $this->registry->funct->cookie($this->cookieName, $sid, $permanent);
- $this->authDb->query("REPLACE INTO sessions (sid, uid, hostname, timestamp) VALUES ('$sid', '" . $this->authUser['uid'] . "', '" . $this->authDb->escape_string($_SERVER['REMOTE_ADDR']) . "', " . time() . ")");
+ BSFunctions::cookie($this->cookieName, $sid, $permanent);
+ $this->authDb->query("REPLACE INTO sessions (sid, uid, hostname, timestamp) VALUES ('$sid', '" . $this->authUser['uid'] . "', '" . $this->authDb->escapeString($_SERVER['REMOTE_ADDR']) . "', " . time() . ")");
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
function _setupDatabase()
{
// connect to the DB
- $this->authDb = new DB_MySQL($this->registry);
- $this->authDb->connect('DATABASE_SERVER', 'DATABASE_USER', 'DATABASE_PASSWORD', 'DATABASE_NAME', false);
+ $this->authDb = new BSDbMySQLI($this->registry);
+ $this->authDb->connect('DATABASE_SERVER', 'DATABASE_USER', 'DATABASE_PASSWORD', 'DATABASE_NAME');
}
// ###################################################################
function _fetchCookieUniqueId()
{
- $val = $this->registry->in[$this->cookieName . '_sid'];
+ $val = BSApp::$input->in[$this->cookieName . '_sid'];
return (!$val ? -1 : $val); // hack so we don't do stupid things but can still create a session
}
// ###################################################################
function _fetchUserUsingCookies()
{
- $session = $this->authDb->query_first("SELECT * FROM {$this->phpBBTablePrefix}sessions WHERE session_id = '" . $this->authDb->escape_string($this->_fetchCookieUniqueId()) . "'");
+ $session = $this->authDb->queryFirst("SELECT * FROM {$this->phpBBTablePrefix}sessions WHERE session_id = '" . $this->authDb->escapeString($this->_fetchCookieUniqueId()) . "'");
if (!$session)
{
// phpBB's wacky auto-login system
{
return false;
}
- return $this->authDb->query_first("SELECT * FROM {$this->phpBBTablePrefix}users WHERE user_id = " . $this->registry->clean($data['userid'], TYPE_UINT) . " AND user_password = '" . $this->authDb->escape_string($data['autologinid']) . "'");
+ return $this->authDb->queryFirst("SELECT * FROM {$this->phpBBTablePrefix}users WHERE user_id = " . BSApp::$input->clean($data['userid'], TYPE_UINT) . " AND user_password = '" . $this->authDb->escapeString($data['autologinid']) . "'");
}
else
{
{
return false;
}
- return $this->authDb->query_first("SELECT * FROM {$this->phpBBTablePrefix}users WHERE user_id = " . $session['session_user_id']);
+ return $this->authDb->queryFirst("SELECT * FROM {$this->phpBBTablePrefix}users WHERE user_id = " . $session['session_user_id']);
}
}
// ###################################################################
function _fetchUserWithIdentifier($string)
{
- return $this->authDb->query_first("SELECT * FROM {$this->phpBBTablePrefix}users WHERE username = '" . $this->authDb->escape_string($string) . "'");
+ return $this->authDb->queryFirst("SELECT * FROM {$this->phpBBTablePrefix}users WHERE username = '" . $this->authDb->escapeString($string) . "'");
}
// ###################################################################
// ###################################################################
function clearCookies()
{
- $this->registry->funct->cookie($this->cookieName . '_data');
- $this->registry->funct->cookie($this->cookieName . '_sid');
- $this->authDb->query("DELETE FROM {$this->phpBBTablePrefix}sessions WHERE session_id = '" . $this->authDb->escape_string($this->_fetchCookieUniqueId()) . "'");
+ BSFunctions::cookie($this->cookieName . '_data');
+ BSFunctions::cookie($this->cookieName . '_sid');
+ $this->authDb->query("DELETE FROM {$this->phpBBTablePrefix}sessions WHERE session_id = '" . $this->authDb->escapeString($this->_fetchCookieUniqueId()) . "'");
}
// ###################################################################
{
$sid = $this->_fetchCookieUniqueId();
$sid = ($sid != '-1' ? $sid : md5(microtime() . rand()));
- $this->registry->funct->cookie($this->cookieName . '_sid', $sid, false);
+ BSFunctions::cookie($this->cookieName . '_sid', $sid, false);
if ($permanent)
{
- $this->registry->funct->cookie($this->cookieName . '_data', serialize(array('autologinid' => $this->authUser['user_password'], 'userid' => $this->authUser['user_id'])), true);
+ BSFunctions::cookie($this->cookieName . '_data', serialize(array('autologinid' => $this->authUser['user_password'], 'userid' => $this->authUser['user_id'])), true);
}
$this->authDb->query("
REPLACE INTO {$this->phpBBTablePrefix}sessions
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
function _setupDatabase()
{
- $this->authDb = new DB_MySQL($this->registry);
- $this->authDb->connect('VBULLETIN_DATABASE_SERVER', 'VB_DATABASE_USER', 'VB_DATABASE_PASSWORD', 'VBULLETIN_DATABASE_NAME', false);
+ $this->authDb = new BSDbMySqlI($this->registry);
+ $this->authDb->connect('VBULLETIN_DATABASE_SERVER', 'VB_DATABASE_USER', 'VB_DATABASE_PASSWORD', 'VBULLETIN_DATABASE_NAME');
}
// ###################################################################
function _fetchCookieUniqueId()
{
- return $this->registry->input_clean('bbuserid', TYPE_UINT);
+ return BSApp::$input->inputClean('bbuserid', TYPE_UINT);
}
// ###################################################################
function _fetchCookiePassword()
{
- return $this->registry->in['bbpassword'];
+ return BSApp::$input->in['bbpassword'];
}
// ###################################################################
function _fetchUserUsingCookies()
{
- return $this->authDb->query_first("SELECT * FROM {$this->vBTablePrefix}user WHERE userid = " . $this->_fetchCookieUniqueId());
+ return $this->authDb->queryFirst("SELECT * FROM {$this->vBTablePrefix}user WHERE userid = " . $this->_fetchCookieUniqueId());
}
// ###################################################################
// ###################################################################
function _setCookies($sticky = false)
{
- $this->registry->funct->cookie('bbuserid', $this->authUser['userid'], $sticky);
- $this->registry->funct->cookie('bbpassword', md5($this->authUser['password'] . $this->licenseKey), $sticky);
+ BSFunctions::cookie('bbuserid', $this->authUser['userid'], $sticky);
+ BSFunctions::cookie('bbpassword', md5($this->authUser['password'] . $this->licenseKey), $sticky);
}
// ###################################################################
function clearCookies()
{
- $this->registry->funct->cookie('bbpassword');
- $this->registry->funct->cookie('bbuserid');
+ BSFunctions::cookie('bbpassword', false);
+ BSFunctions::cookie('bbuserid', false);
}
// ###################################################################
function _fetchUserWithIdentifier($username)
{
- return $this->authDb->query_first("SELECT * FROM {$this->vBTablePrefix}user WHERE username = '" . $this->authDb->escape_string($username) . "'");
+ return $this->authDb->queryFirst("SELECT * FROM {$this->vBTablePrefix}user WHERE username = '" . $this->authDb->escapeString($username) . "'");
}
// ###################################################################
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
* links for the Admin CP.
*
* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
+* @copyright Copyright (c)2004 - 2008, Blue Static
* @version $Revision$
* @package Bugdar
*
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
+++ /dev/null
-<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version 2 of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-/**
-* API Error Handler
-*
-* This class is used to catch different kinds of API errors and throw the
-* appropriate front-size error depending on the context. Unlike normal
-* handlers, this class can be both instantiated and used statically: check
-* the method documentation for more information.
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
-class API_Error_Handler
-{
- /**
- * Instance of an object that can run erros
- * @var object
- * @access private
- */
- var $object = null;
-
- // ###################################################################
- /**
- * Constructor: set the actionable object
- *
- * @access public
- *
- * @param object Actionable object
- */
- function API_Error_Handler(&$obj)
- {
- $this->object =& $obj;
- }
-
- // ###################################################################
- /**
- * The user-end cumulative reporter requires that the class be
- * instantiated. This collects messages in the set message reporting
- * object, but never throws the error. It is the caller's responsibility
- * to check for the presence of errors and to throw the front-end
- * warning using the message object.
- *
- * @access public
- *
- * @param string Error message
- */
- function user_cumulative($error)
- {
- $this->object->addError($error);
- }
-
- // ###################################################################
- /**
- * This calls the simple ISSO.Printer error message for the
- * administrative-side errors.
- *
- * @access public
- *
- * @param string Error message
- */
- function admin_error($error)
- {
- $this->object->error($error);
- }
-}
-
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
-?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
*/
/**
-* Bug Change Logging
-*
-* This class is used to record changes in a bug's fields, comments, and
-* attachments.
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
+ * Bug Change Logging
+ *
+ * This class is used to record changes in a bug's fields, comments, and
+ * attachments.
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
class Logging
{
/**
- * Bug ID
- * @var integer
- * @access private
- */
- var $bugid = 0;
+ * Bug ID
+ * @var integer
+ */
+ private $bugid = 0;
/**
- * Attachment ID
- * @var integer
- * @access private
- */
- var $attachmentid = 0;
+ * Attachment ID
+ * @var integer
+ */
+ private $attachmentid = 0;
/**
- * Comment ID
- * @var integer
- * @access private
- */
- var $commentid = 0;
+ * Comment ID
+ * @var integer
+ */
+ private $commentid = 0;
/**
- * The original data to compare against
- * @var array
- * @access private
- */
- var $original = array();
+ * The original data to compare against
+ * @var array
+ */
+ private $original = array();
/**
- * Modified data
- * @var array
- * @access private
- */
- var $modified = array();
+ * Modified data
+ * @var array
+ */
+ private $modified = array();
/**
- * Compared/diff'd data
- * @var array
- * @access private
- */
- var $compared = array();
+ * Compared/diff'd data
+ * @var array
+ */
+ private $compared = array();
- // ###################################################################
/**
- * Sets the bug ID for the current logging instance
- *
- * @access public
- *
- * @param integer New bug ID
- */
- function set_bugid($id)
+ * Sets the bug ID for the current logging instance
+ *
+ * @param integer New bug ID
+ */
+ public function setBugId($id)
{
- global $bugsys;
- $this->bugid = $bugsys->clean($id, TYPE_UINT);
+ $this->bugid = BSApp::$input->clean($id, TYPE_UINT);
}
- // ###################################################################
/**
- * Sets the attachment ID for the current logging instance
- *
- * @access public
- *
- * @param integer New attachment ID
- */
- function set_attachmentid($id)
+ * Sets the attachment ID for the current logging instance
+ *
+ * @param integer New attachment ID
+ */
+ public function setAttachmentId($id)
{
- global $bugsys;
- $this->attachmentid = $bugsys->clean($id, TYPE_UINT);
+ $this->attachmentid = BSApp::$input->clean($id, TYPE_UINT);
}
- // ###################################################################
/**
- * Sets the current comment ID to be logged
- *
- * @access public
- *
- * @param integer New comment ID
- */
- function set_commentid($id)
+ * Sets the current comment ID to be logged
+ *
+ * @param integer New comment ID
+ */
+ public function setCommentId($id)
{
- global $bugsys;
- $this->commentid = $bugsys->clean($id, TYPE_UINT);
+ $this->commentid = BSApp::$input->clean($id, TYPE_UINT);
}
- // ###################################################################
/**
- * Assigns data into the $this->original or $this->modified array based
- * on the passed arrays of information and the fields to add (and what
- * name to add them under), and any prefix
- *
- * @access public
- *
- * @param bool TRUE for original, FALSE for modified
- * @param array Data array
- * @param array List of fields in the data array to add; in format of array('field name' => 'display name', 'display name 2', 'display name 3')
- * @param bool If TRUE, then the list of fields is used to exclude, not include
- * @param string Field prefix
- */
- function add_data($orig, $data, $fields, $exclude = false, $prefix = '')
+ * Assigns data into the $this->original or $this->modified array based
+ * on the passed arrays of information and the fields to add (and what
+ * name to add them under), and any prefix
+ *
+ * @param bool TRUE for original, FALSE for modified
+ * @param array Data array
+ * @param array List of fields in the data array to add; in format of array('field name' => 'display name', 'display name 2', 'display name 3')
+ * @param bool If TRUE, then the list of fields is used to exclude, not include
+ * @param string Field prefix
+ */
+ public function addData($orig, $data, $fields, $exclude = false, $prefix = '')
{
$array = ($orig ? 'original' : 'modified');
$prefix .= '.';
if ($exclude == false)
{
- foreach ($fields AS $fname => $fdisplay)
+ foreach ($fields as $fname => $fdisplay)
{
if (is_numeric($fname))
{
}
else
{
- foreach ($data AS $fname => $value)
+ foreach ($data as $fname => $value)
{
if (!in_array($fname, $fields))
{
}
}
- // ###################################################################
/**
- * Populates the $this->compared array as a diff between the original
- * and modified data. This is then used to create the databse queries.
- *
- * @access private
- */
- function compare_arrays()
+ * Populates the $this->compared array as a diff between the original
+ * and modified data. This is then used to create the databse queries.
+ */
+ private function _compareArrays()
{
foreach ($this->modified AS $key => $value)
{
- if ($this->original["$key"] != $value AND !($value['value'] == '' AND $this->original["$key"]['value'] == '0') AND !($this->original["$key"]['value'] == '' AND $value['value'] == '0'))
+ if ($this->original["$key"] != $value && !($value['value'] == '' && $this->original["$key"]['value'] == '0') && !($this->original["$key"]['value'] == '' && $value['value'] == '0'))
{
$this->compared["$key"] = array('old' => $this->original["$key"]['value'], 'new' => $this->modified["$key"]['value']);
}
}
}
- // ###################################################################
/**
- * Runs $this->compare_arrays() and then takes the result and prepares
- * it for insertion into the history database.
- *
- * @access public
- */
- function update_history()
+ * Runs $this->_compareArrays() and then takes the result and prepares
+ * it for insertion into the history database.
+ */
+ public function updateHistory()
{
- global $bugsys;
-
- $this->compare_arrays();
+ $this->_compareArrays();
- foreach ($this->compared AS $field => $values)
+ foreach ($this->compared as $field => $values)
{
- $bugsys->db->query("
+ BSApp::$db->query("
INSERT INTO " . TABLE_PREFIX . "history
(bugid, attachmentid, commentid, dateline, userid, field, original, changed)
VALUES
- (" . $bugsys->clean($this->bugid, TYPE_UINT) . ", " . $bugsys->clean($this->attachmentid, TYPE_UINT) . ",
- " . $bugsys->clean($this->commentid, TYPE_UINT) . ", " . TIMENOW . ", " . $bugsys->userinfo['userid'] . ",
- '" . $bugsys->db->escape_string($field) . "', '" . $bugsys->db->escape_string($values['old']) . "',
- '" . $bugsys->db->escape_string($values['new']) . "'
+ (" . BSApp::$input->clean($this->bugid, TYPE_UINT) . ", " . BSApp::$input->clean($this->attachmentid, TYPE_UINT) . ",
+ " . BSApp::$input->clean($this->commentid, TYPE_UINT) . ", " . TIMENOW . ", " . bugdar::$userinfo['userid'] . ",
+ '" . BSApp::$db->escapeString($field) . "', '" . BSApp::$db->escapeString($values['old']) . "',
+ '" . BSApp::$db->escapeString($values['new']) . "'
)
");
}
}
- // ###################################################################
/**
- * Returns an array of the fields commonly ignored
- *
- * @access public
- *
- * @return array Fields ignored in logging
- */
- function getCommonFields()
+ * Returns an array of the fields commonly ignored
+ *
+ * @return array Fields ignored in logging
+ */
+ public function getCommonFields()
{
return array(
'bugid',
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
*/
function error($error = null)
{
- global $bugsys;
- global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
-
if ($error == null)
{
$error = $this->errorBox;
}
- eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_error') . '");');
+ $tpl = new BSTemplate('std_error');
+ $tpl->vars = array('error' => $error);
+ $tpl->evaluate()->flush();
exit;
}
*/
function redirect($message, $url)
{
- global $bugsys;
- global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
-
- if ($bugsys->options['redirectheaders'])
+ if (bugdar::$options['redirectheaders'])
{
header("Location: $url");
exit;
}
- eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_redirect') . '");');
+ $tpl = new BSTemplate('std_redirect');
+ $tpl->vars = array(
+ 'message' => $message,
+ 'url' => $url
+ );
+ $tpl->evaluate()->flush();
exit;
}
*/
function message($message)
{
- global $bugsys;
- global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
-
- eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_message') . '");');
+ $tpl = new BSTemplate('std_message');
+ $tpl->vars = array(
+ 'message' => $message
+ );
+ $tpl->evaluate()->flush();
exit;
}
*/
function confirm($message, $action, $do, $button, $cancel, $arrextra)
{
- global $bugsys;
- global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
+ global $show;
$show['confirm'] = true;
- foreach ($arrextra AS $name => $value)
+ foreach ($arrextra as $name => $value)
{
$extra .= '<input type="hidden" name="' . $name . '" value="' . $value . '" />' . "\n";
}
- eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_message') . '");');
+ $tpl = new BSTemplate('std_message');
+ $tpl->vars = array(
+ 'message' => $message,
+ 'action' => $action,
+ 'do' => $do,
+ 'button' => $button,
+ 'cancel' => $cancel,
+ 'extra' => $extra
+ );
+ $tpl->evaluate()->flush();
exit;
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
*
* @author rsesek
* @copyright Copyright (c)2006 - 2008, Blue Static
- * @version $Revision$
* @package Bugdar
*
*/
*/
function _loadFile()
{
- global $bugsys;
-
$this->file = @fopen($this->filename, 'r');
if (!$this->file)
{
- $bugsys->debug("could not open MO file {$this->filename}");
+ BSApp::debug("could not open MO file {$this->filename}");
return;
}
}
else
{
- trigger_error('Invalid MO file format');
+ throw new Exception('Invalid MO file format');
}
// read the revision (unused in MOs)
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
\*=====================================================================*/
/**
-* Notification Center
-*
-* This class determines which emails need to be sent out based on user
-* options and bug changes, and then it sends said emails.
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
+ * Notification Center
+ *
+ * This class determines which emails need to be sent out based on user
+ * options and bug changes, and then it sends said emails.
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
class NotificationCenter
{
/**
- * Bug information
- * @var array
- * @access private
- */
- var $bug = array();
-
- /**
- * Original bug data
- * @var array
- * @access private
- */
- var $original = array();
+ * Bug information
+ * @var array
+ */
+ private $bug = array();
/**
- * Modified bug data
- * @var array
- * @access private
- */
- var $modified = array();
+ * Original bug data
+ * @var array
+ */
+ private $original = array();
/**
- * Global bugsys registry
- * @var object
- * @access private
- */
- var $registry = null;
+ * Modified bug data
+ * @var array
+ */
+ private $modified = array();
/**
- * Role list: a list of user IDs with their relations to the bug
- * @var array
- * @access private
- */
- var $roles = array(
+ * Role list: a list of user IDs with their relations to the bug
+ * @var array
+ */
+ private $roles = array(
'-notapplicable-' => array(),
'reporter' => array(),
'assignee' => array(),
);
/**
- * User cache list
- * @var array
- * @access private
- */
- var $users = array();
+ * User cache list
+ * @var array
+ */
+ private $users = array();
/**
- * A list of notices per-user that are combined together in NotificationCenter::finalize()
- * @var array
- * @access private
- */
- var $notices = array();
+ * A list of notices per-user that are combined together in NotificationCenter::finalize()
+ * @var array
+ */
+ private $notices = array();
- // ###################################################################
/**
- * Constructor: set database objects
- *
- * @access public
- */
- function __construct()
- {
- global $bugsys;
-
- $this->registry =& $bugsys;
- }
-
- // ###################################################################
- /**
- * (PHP 4) Constructor
- *
- * @access public
- */
- function NotificationCenter()
- {
- $this->__construct();
- }
-
- // ###################################################################
- /**
- * Sets the bug data so that all methods in this class have access to
- * it when sending emails.
- *
- * @access public
- *
- * @param array Original bug data
- * @param array Modified bug data
- */
- function set_bug_data($original, $modified = array())
+ * Sets the bug data so that all methods in this class have access to
+ * it when sending emails.
+ *
+ * @param array Original bug data
+ * @param array Modified bug data
+ */
+ public function setBugData($original, $modified = array())
{
if (sizeof($modified) > 0)
{
$this->roles['reporter'] = array($original['userid']);
$this->roles['assignee'][] = (sizeof($modified) > 0 ? $modified['assignedto'] : $original['assignedto']);
- $this->fetch_user_cache();
+ $this->_fetchUserCache();
}
- // ###################################################################
/**
- * Fetches all the users who could be related to the bug and sticks
- * their information into an array.
- *
- * @access private
- */
- function fetch_user_cache()
+ * Fetches all the users who could be related to the bug and sticks
+ * their information into an array.
+ */
+ private function _fetchUserCache()
{
- $newbuggers = $this->registry->db->query("SELECT userid FROM " . TABLE_PREFIX . "useremail WHERE relation = " . $this->registry->emailoptions['relations']['-notapplicable-'] . " AND mask & " . $this->registry->emailoptions['notifications']['newbug']);
- while ($newbug = $this->registry->db->fetch_array($newbuggers))
+ $newbuggers = BSApp::$db->query("SELECT userid FROM " . TABLE_PREFIX . "useremail WHERE relation = " . bugdar::$emailOptions['relations']['-notapplicable-'] . " AND mask & " . bugdar::$emailOptions['notifications']['newbug']);
+ foreach ($newbuggers as $newbug)
{
$this->roles['-notapplicable-']["$newbug[userid]"] = $newbug['userid'];
}
- $favorites = $this->registry->db->query("SELECT userid FROM " . TABLE_PREFIX . "favorite WHERE bugid = " . $this->registry->clean($this->bug['bugid'], TYPE_UINT));
- while ($fav = $this->registry->db->fetch_array($favorites))
+ $favorites = BSApp::$db->query("SELECT userid FROM " . TABLE_PREFIX . "favorite WHERE bugid = " . BSApp::$input->clean($this->bug['bugid'], TYPE_UINT));
+ foreach ($favorites as $fav)
{
$this->roles['favorite']["$fav[userid]"] = $fav['userid'];
}
- $voters = $this->registry->db->query_first("SELECT userids FROM " . TABLE_PREFIX . "vote WHERE bugid = " . $this->registry->clean($this->bug['bugid'], TYPE_UINT));
+ $voters = BSApp::$db->queryFirst("SELECT userids FROM " . TABLE_PREFIX . "vote WHERE bugid = " . BSApp::$input->clean($this->bug['bugid'], TYPE_UINT));
$this->roles['voter'] = preg_split('#,#', $voters['userids'], 0, PREG_SPLIT_NO_EMPTY);
- $commenters = $this->registry->db->query("SELECT userid FROM " . TABLE_PREFIX . "comment WHERE bugid = " . $this->registry->clean($this->bug['bugid'], TYPE_UINT));
- while ($comment = $this->registry->db->fetch_array($commenters))
+ $commenters = BSApp::$db->query("SELECT userid FROM " . TABLE_PREFIX . "comment WHERE bugid = " . BSApp::$input->clean($this->bug['bugid'], TYPE_UINT));
+ foreach ($commenters as $comment)
{
$this->roles['commenter']["$comment[userid]"] = $comment['userid'];
}
$masterids = array_merge($this->roles['-notapplicable-'], $this->roles['reporter'], $this->roles['assignee'], $this->roles['favorite'], $this->roles['voter'], $this->roles['commenter']);
- $masterids = $this->registry->funct->array_strip_empty(array_unique($masterids));
+ $masterids = BSFunctions::array_strip_empty(array_unique($masterids));
- if (is_array($masterids) AND sizeof($masterids) > 0)
+ if (is_array($masterids) && sizeof($masterids) > 0)
{
- $userinfo = $this->registry->db->query("
+ $userinfo = BSApp::$db->query("
SELECT user.*, useremail.*
FROM " . TABLE_PREFIX . "useremail AS useremail
LEFT JOIN " . TABLE_PREFIX . "user AS user
ON (user.userid = useremail.userid)
WHERE useremail.userid IN (" . implode(',', $masterids) . ")
");
- while ($user = $this->registry->db->fetch_array($userinfo))
+ foreach ($userinfo as $user)
{
if (!is_array($this->users["$user[userid]"]))
{
}
}
- // ###################################################################
/**
- * Sends the appropriate emails for changes to bugs. This function
- * works a lot like the Logging class by taking BugAPI->objdata and
- * BugAPI->values and then comparing the two arries and sending emails
- * with the differences.
- *
- * @access public
- */
- function send_bug_changes_notice()
+ * Sends the appropriate emails for changes to bugs. This function
+ * works a lot like the Logging class by taking BugAPI->record and
+ * BugAPI->values and then comparing the two arries and sending emails
+ * with the differences.
+ */
+ public function sendBugChangeNotice()
{
if (!isset($this->modified['bugid']))
{
{
if ($this->original['assignedto'] != '')
{
- $this->notice_no_longer_assigned($this->original['assignedto']);
+ $this->_noticeNoLongerAssigned($this->original['assignedto']);
}
if ($this->modified['assignedto'] != '')
{
- $this->notice_now_assigned($this->modified['assignedto']);
+ $this->_noticeNowAssigned($this->modified['assignedto']);
}
}
if ($this->original['status'] != $this->modified['status'])
{
- $this->notice_status_change($this->original['status'], $this->modified['status']);
+ $this->_noticeStatusChange($this->original['status'], $this->modified['status']);
}
if ($this->original['resolution'] != $this->modified['resolution'])
{
- $this->notice_resolution_change($this->original['resolution'], $this->modified['resolution']);
+ $this->_noticeResolutionChange($this->original['resolution'], $this->modified['resolution']);
}
if ($this->original['duplicates'] != $this->modified['duplicates'])
{
- $this->notice_duplicates_change($this->original['duplicates'], $this->modified['duplicates']);
+ $this->_noticeDuplicatesChange($this->original['duplicates'], $this->modified['duplicates']);
}
// other standard fields that don't have custom masks
if ($this->original['severity'] != $this->modified['severity'])
{
- $this->notice_severity_change($this->original['severity'], $this->modified['severity']);
+ $this->_noticeSeverityChange($this->original['severity'], $this->modified['severity']);
}
if ($this->original['priority'] != $this->modified['priority'])
{
- $this->notice_priority_change($this->original['priority'], $this->modified['priority']);
+ $this->_noticePriorityChange($this->original['priority'], $this->modified['priority']);
}
- if (($this->original['product'] != $this->modified['product']) OR ($this->original['component'] != $this->modified['component']) OR ($this->original['version'] != $this->modified['version']))
+ if (($this->original['product'] != $this->modified['product']) || ($this->original['component'] != $this->modified['component']) || ($this->original['version'] != $this->modified['version']))
{
- $this->notice_pcv_change(array($this->original['product'], $this->original['component'], $this->original['version']), array($this->modified['product'], $this->modified['component'], $this->modified['version']));
+ $this->_noticePCVChange(array($this->original['product'], $this->original['component'], $this->original['version']), array($this->modified['product'], $this->modified['component'], $this->modified['version']));
}
$dofields = array(
'dependency' => -1,
'hidden' => -1
);
- foreach ($dofields AS $field => $lookup)
+ foreach ($dofields as $field => $lookup)
{
if ($this->original["$field"] != $this->modified["$field"])
{
- $this->notice_other_change($field, $this->original["$field"], $this->modified["$field"]);
+ $this->_noticeOtherChange($field, $this->original["$field"], $this->modified["$field"]);
}
}
}
- // ###################################################################
/**
- * Sends an email to the specified user ID that they are no longer the
- * person assigned to the bug.
- *
- * @access private
- *
- * @param integer User ID to send to
- */
- function notice_no_longer_assigned($userid)
+ * Sends an email to the specified user ID that they are no longer the
+ * person assigned to the bug.
+ *
+ * @param integer User ID to send to
+ */
+ private function _noticeNoLongerAssigned($userid)
{
- if ($this->users["$userid"]['options'][0] & $this->registry->emailoptions['notifications']['assignedto'] AND in_array($userid, $this->roles['-notapplicable-']))
+ if ($this->users["$userid"]['options'][0] & bugdar::$emailOptions['notifications']['assignedto'] && in_array($userid, $this->roles['-notapplicable-']))
{
- $user = construct_user_display($this->registry->userinfo, false);
- eval('$part = "' . $this->registry->template->fetch(FetchEmailPath('notice_unassigned.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$userid"][] = $part;
+ $user = construct_user_display(bugdar::$userinfo, false);
+
+ $email = get_email_text('notice_unassigned');
+ $this->notices["$userid"][] = sprintf($email['part'], $user);
}
}
- // ###################################################################
/**
- * Informs the user that they have been made the assignee of the bug.
- *
- * @access private
- *
- * @param integer User ID
- */
- function notice_now_assigned($userid)
+ * Informs the user that they have been made the assignee of the bug.
+ *
+ * @param integer User ID
+ */
+ private function _noticeNowAssigned($userid)
{
- if ($this->users["$userid"]['options'][0] & $this->registry->emailoptions['notifications']['assignedto'] AND in_array($userid, $this->roles['-notapplicable-']))
+ if ($this->users["$userid"]['options'][0] & bugdar::$emailOptions['notifications']['assignedto'] && in_array($userid, $this->roles['-notapplicable-']))
{
- $user = construct_user_display($this->registry->userinfo, false);
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_assigned.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$userid"][] = $email;
+ $user = construct_user_display(bugdar::$userinfo, false);
+
+ $email = get_email_text('notice_assigned');
+ $this->notices["$userid"][] = sprintf($email['part'], $user);
}
}
- // ###################################################################
/**
- * Sends a message to inform users that the status has changed.
- *
- * @access private
- *
- * @param integer Old status
- * @param integer New status
- */
- function notice_status_change($old, $new)
+ * Sends a message to inform users that the status has changed.
+ *
+ * @param integer Old status
+ * @param integer New status
+ */
+ private function _noticeStatusChange($old, $new)
{
- $userlist = $this->fetch_users_with_on_bit('statusresolve');
- foreach ($userlist AS $userid => $user)
+ $userlist = $this->_fetchUsersWithOnBit('statusresolve');
+
+ $old = bugdar::$datastore['status'][$old]['status'];
+ $new = bugdar::$datastore['status'][$new]['status'];
+
+ foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_status.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_status');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $new, $old);
}
}
- // ###################################################################
/**
- * Sends an email to inform users that the resolution has changed.
- *
- * @access private
- *
- * @param integer Old resolution
- * @param integer New resolution
- */
- function notice_resolution_change($old, $new)
+ * Sends an email to inform users that the resolution has changed.
+ *
+ * @param integer Old resolution
+ * @param integer New resolution
+ */
+ private function _noticeResolutionChange($old, $new)
{
- $userlist = $this->fetch_users_with_on_bit('statusresolve');
- foreach ($userlist AS $userid => $user)
+ $userlist = $this->_fetchUsersWithOnBit('statusresolve');
+
+ $old = bugdar::$datastore['resolution'][$old]['resolution'];
+ $new = bugdar::$datastore['resolution'][$new]['resolution'];
+
+ foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_resolution.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_resolution');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $new, $old);
}
}
- // ###################################################################
/**
- * Informs users that the duplicates list has changed.
- *
- * @access private
- *
- * @param string Old duplicates list
- * @param string New duplicates list
- */
- function notice_duplicates_change($old, $new)
+ * Informs users that the duplicates list has changed.
+ *
+ * @param string Old duplicates list
+ * @param string New duplicates list
+ */
+ private function _noticeDuplicatesChange($old, $new)
{
- $userlist = $this->fetch_useres_with_on_bit('duplicates');
- foreach ($userlist AS $userid => $user)
+ $userlist = $this->_fetchUsersWithOnBit('duplicates');
+
+ foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_duplicates.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_duplicates');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $old, $new);
}
}
- // ###################################################################
/**
- * Sends an email to inform users that the severity has changed.
- *
- * @access private
- *
- * @param integer Old severity
- * @param integer New severity
- */
- function notice_severity_change($old, $new)
+ * Sends an email to inform users that the severity has changed.
+ *
+ * @param integer Old severity
+ * @param integer New severity
+ */
+ private function _noticeSeverityChange($old, $new)
{
- $userlist = $this->fetch_users_with_on_bit('otherfield');
- foreach ($userlist AS $userid => $user)
+ $userlist = $this->_fetchUsersWithOnBit('otherfield');
+
+ $old = bugdar::$datastore['severity'][$old]['severity'];
+ $new = bugdar::$datastore['severity'][$new]['severity'];
+
+ foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_severity.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $old, $new);
}
}
- // ###################################################################
/**
- * Informs users that the priority changed.
- *
- * @access private
- *
- * @param integer Old priority
- * @param integer New priority
- */
- function notice_priority_change($old, $new)
+ * Informs users that the priority changed.
+ *
+ * @param integer Old priority
+ * @param integer New priority
+ */
+ private function _noticePriorityChange($old, $new)
{
- $userlist = $this->fetch_users_with_on_bit('otherfield');
- foreach ($userlist AS $userid => $user)
+ $userlist = $this->_fetchUsersWithOnBit('otherfield');
+
+ $old = bugdar::$datastore['priority'][$old]['priority'];
+ $new = bugdar::$datastore['priority'][$new]['priority'];
+
+ foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_priority.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_priority');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $old, $new);
}
}
- // ###################################################################
/**
- * Sends an email telling users that the product, component, or version
- * has changed. This is done all at once because you really need to see
- * the whole thing in the notice.
- *
- * @access private
- *
- * @param array Original PCV
- * @param array Modified PCV
- */
- function notice_pcv_change($old, $new)
+ * Sends an email telling users that the product, component, or version
+ * has changed. This is done all at once because you really need to see
+ * the whole thing in the notice.
+ *
+ * @param array Original PCV
+ * @param array Modified PCV
+ */
+ private function _noticePCVChange($old, $new)
{
- $userlist = $this->fetch_users_with_on_bit('otherfield');
+ $userlist = $this->_fetchUsersWithOnBit('otherfield');
+
+ $products = &bugdar::$datastore['product'];
+ $versions = &bugdar::$datastore['version'];
- $old = $this->registry->datastore['product']["$old[0]"]['title'] . '/' . ($old[1] ? $this->registry->datastore['product']["$old[1]"]['title'] . '/' : '') . $this->registry->datastore['version']["$old[2]"]['version'];
- $new = $this->registry->datastore['product']["$new[0]"]['title'] . '/' . ($new[1] ? $this->registry->datastore['product']["$new[1]"]['title'] . '/' : '') . $this->registry->datastore['version']["$new[2]"]['version'];
+ $old = $products[$old[0]]['title'] . '/' . ($old[1] ? $products[$old[1]]['title'] . '/' : '') . $versions[$old[2]]['version'];
+ $new = $products[$new[0]]['title'] . '/' . ($new[1] ? $products[$new[1]]['title'] . '/' : '') . $versions[$new[2]]['version'];
- foreach ($userlist AS $userid => $user)
+ foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_product.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_product');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $old, $new);
}
}
- // ###################################################################
/**
* Sends the appropriate users information about a new comment being
* posted to the bug report.
*
- * @access public
- *
* @param array CommentAPI->values array
*/
- function send_new_comment_notice($comment)
+ public function sendNewCommentNotice($comment)
{
- $userlist = $this->fetch_users_with_on_bit('newcomment');
- foreach ($userlist AS $userid => $user)
+ $userlist = $this->_fetchUsersWithOnBit('newcomment');
+ foreach ($userlist as $userid => $user)
{
- $user = construct_user_display($this->registry->userinfo, false);
- $date = $this->registry->modules['date']->format($this->registry->options['dateformat'], $comment['dateline']);
+ $user = construct_user_display(bugdar::$userinfo, false);
+ $date = BSApp::$date->format(bugdar::$options['dateformat'], $comment['dateline']);
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_comment.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$userid"][] = $email;
+ $email = get_email_text('notice_comment');
+ $this->notices["$userid"][] = sprintf($email['part'], $user, $date, $comment['comment']);
}
}
- // ###################################################################
/**
- * A notice for an individual field changing.
- *
- * @access private
- *
- * @param string Field name
- * @param mixed Original value
- * @param mixed Modified value
- */
- function notice_other_change($name, $old, $new)
+ * A notice for an individual field changing.
+ *
+ * @param string Field name
+ * @param mixed Original value
+ * @param mixed Modified value
+ */
+ private function _noticeOtherChange($name, $old, $new)
{
- $userlist = $this->fetch_users_with_on_bit('otherfield');
- foreach ($userlist AS $userid => $user)
+ $userlist = $this->_fetchUsersWithOnBit('otherfield');
+ foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_other.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_other');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $name, $old, $new);
}
}
- // ###################################################################
/**
- * Sends appropriate users a notice when a new attachment has been
- * added.
- *
- * @access public
- *
- * @param array AttachmentAPI->values array
- * @param array List of all attachments made obsolete
- * @param array Newly-inserted attachment ID
- */
- function send_new_attachment_notice($attachment, $obsolete, $id)
+ * Sends appropriate users a notice when a new attachment has been
+ * added.
+ *
+ * @param array AttachmentAPI->values array
+ * @param array List of all attachments made obsolete
+ * @param array Newly-inserted attachment ID
+ */
+ public function sendNewAttachmentNotice($attachment, $obsolete, $id)
{
- $userlist = $this->fetch_users_with_on_bit('newattachment');
- foreach ($userlist AS $userid => $user)
+ $userlist = $this->_fetchUsersWithOnBit('newattachment');
+ foreach ($userlist as $userid => $user)
{
- $user = construct_user_display($this->registry->userinfo, false);
+ $user = construct_user_display(bugdar::$userinfo, false);
$obsoletes = implode(', ', (array)$obsolete);
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_attachment.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$userid"][] = $email;
+ $email = get_email_text('notice_attachment');
+ $this->notices["$userid"][] = sprintf($email['part'], $user, $attachment['filename'], $attachment['description'], $attachment['filesize'], $obsoletes, bugdar::$options['trackerurl'], $attachment['attachmentid']);
}
}
- // ###################################################################
/**
- * Sends a new bug notification notice to all those who have the option
- * turned no. This does not use fetch_users_with_on_bit() because a
- * query is more effective.
- *
- * @access public
- *
- * @param array Bug values array
- * @param array Comment values array
- */
- function send_new_bug_notice($bug, $comment)
+ * Sends a new bug notification notice to all those who have the option
+ * turned no. This does not use fetchUsersWithOnBit() because a
+ * query is more effective.
+ *
+ * @param array Bug values array
+ * @param array Comment values array
+ */
+ public function sendNewBugNotice($bug, $comment)
{
- $userinfo = $this->registry->db->query("
+ $userinfo = BSApp::$db->query("
SELECT user.*, useremail.*
FROM " . TABLE_PREFIX . "useremail AS useremail
LEFT JOIN " . TABLE_PREFIX . "user AS user
ON (user.userid = useremail.userid)
WHERE useremail.relation = 0
- AND useremail.mask & " . $this->registry->emailoptions['notifications']['newbug'] . "
+ AND useremail.mask & " . bugdar::$emailOptions['notifications']['newbug'] . "
");
- while ($userInfo = $this->registry->db->fetch_array($userinfo))
+ foreach ($userinfo as $userInfo)
{
if (!is_array($this->users["$userInfo[userid]"]))
{
- $user = construct_user_display($this->registry->userinfo, false);
+ $user = construct_user_display(bugdar::$userinfo, false);
$this->users["$userInfo[userid]"] = $userInfo;
- $product = $this->registry->datastore['product']["$bug[product]"]['title'] . '/' . ($bug['component'] ? $this->registry->datastore['product']["$bug[component]"]['title'] . '/' : '') . $this->registry->datastore['version']["$bug[version]"]['version'];
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_new_bug.part', $this->_localeFromUserId($userInfo['userid']))) . '";');
- $this->notices["$userInfo[userid]"][] = $email;
+ $product = bugdar::$datastore['product']["$bug[product]"]['title'] . '/' . ($bug['component'] ? bugdar::$datastore['product']["$bug[component]"]['title'] . '/' : '') . bugdar::$datastore['version']["$bug[version]"]['version'];
+
+ $email = get_email_text('notice_new_bug');
+ $this->notices["$userInfo[userid]"][] = sprintf($email['part'], $bug['bugid'], $bug['summary'], $user, $product, $comment['comment']);
unset($this->users["$userInfo[userid]"]['mask'], $this->users["$userInfo[userid]"]['relation']);
}
$this->users["$userInfo[userid]"]['options']["$userInfo[relation]"] = $userInfo['mask'];
}
}
- // ###################################################################
/**
- * Generates an array of users who have a given email notification flag
- * turned on in their bitfields.
- *
- * @access private
- *
- * @param string Notification bitfield name
- *
- * @return array Array of users and their data
- */
- function fetch_users_with_on_bit($bitname)
+ * Generates an array of users who have a given email notification flag
+ * turned on in their bitfields.
+ *
+ * @param string Notification bitfield name
+ *
+ * @return array Array of users and their data
+ */
+ private function _fetchUsersWithOnBit($bitname)
{
$idlist = array();
- foreach ($this->users AS $user)
+ foreach ($this->users as $user)
{
- foreach ($this->registry->emailoptions['relations'] AS $name => $bit)
+ foreach (bugdar::$emailOptions['relations'] as $name => $bit)
{
- if (in_array($user['userid'], $this->roles["$name"]) AND $user['options']["$bit"] & $this->registry->emailoptions['notifications']["$bitname"])
+ if (in_array($user['userid'], $this->roles["$name"]) && $user['options']["$bit"] & bugdar::$emailOptions['notifications']["$bitname"])
{
$idlist[] = $user['userid'];
}
$masters = array_unique($idlist);
$return = array();
- foreach ($masters AS $userid)
+ foreach ($masters as $userid)
{
- $return["$userid"] =& $this->users["$userid"];
+ $return["$userid"] = &$this->users["$userid"];
}
return $return;
}
- // ###################################################################
/**
- * Compiles and sends the actual emails to users.
- *
- * @access public
- */
- function finalize()
+ * Compiles and sends the actual emails to users.
+ */
+ public function finalize()
{
// get the current bug for permissions checks
- $bug = $this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $this->bug['bugid']);
- foreach ($this->notices AS $userid => $noticelist)
+ $bug = BSApp::$db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $this->bug['bugid']);
+ foreach ($this->notices as $userid => $noticelist)
{
- if ($userid == $this->registry->userinfo['userid'])
+ if ($userid == bugdar::$userinfo['userid'])
{
- $this->registry->debug("skipping user $userid because they're the one doing the thing");
+ BSApp::debug("skipping user $userid because they're the one doing the thing");
continue;
}
// we wouldn't want people who favorite bugs getting hidden notices
if (!check_bug_permissions($bug, $this->users["$userid"]))
{
- $this->registry->debug("skipping user $userid ({$this->users[$userid]['email']}) because of permissions");
+ BSApp::debug("skipping user $userid ({$this->users[$userid]['email']}) because of permissions");
continue;
}
$parts = implode("\n\n", $noticelist);
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('bugnotification.xml', $this->_localeFromUserId($userid))) . '";');
- $email = $this->registry->xml->parse($email, true);
- $this->registry->mail->setSubject($email['email']['subject']['value']);
- $this->registry->mail->setBodyText($email['email']['bodyText']['value']);
+ $email = get_email_text('bug_notification');
+
+ $body = sprintf($email['bodyText'], $this->users[$userid]['displayname'], bugdar::$options['trackertitle'], $this->bug['summary'], $this->bug['bugid'], bugdar::$options['trackerurl'], $parts);
+
+ $mail = new BSMail();
+ $mail->setSubject(sprintf($email['subject'], bugdar::$options['trackertitle'], $this->bug['summary']));
+ $mail->setBodyText($body);
+ $mail->setFromAddress(MAIL_FROM_ADDRESS);
+ $mail->setFromName(MAIL_FROM_NAME);
if (!empty($this->users["$userid"]['email']))
{
- $this->registry->mail->send($this->users["$userid"]['email'], $this->users["$userid"]['displayname']);
+ $mail->send($this->users[$userid]['email'], $this->users[$userid]['displayname']);
}
else
{
- $this->registry->debug("not sending an email to " . $userid . " because they don't have one?");
+ BSApp::debug("not sending an email to " . $userid . " because they don't have one?");
}
}
}
- // ###################################################################
/**
- * Returns the locale name from a given user ID
- *
- * @param integer User ID
- *
- * @return string Locale
- */
- function _localeFromUserId($userid)
+ * Returns the locale name from a given user ID
+ *
+ * @param integer User ID
+ *
+ * @return string Locale
+ */
+ private function _localeFromUserId($userid)
{
- $langcode = $this->registry->datastore['language'][$this->users[$userid]['languageid']]['langcode'];
+ $langcode = bugdar::$datastore['language'][$this->users[$userid]['languageid']]['langcode'];
if (!$langcode)
{
- $langcode = $this->registry->datastore['language'][$this->registry->options['defaultlanguage']]['langcode'];
+ $langcode = bugdar::$datastore['language'][bugdar::$options['defaultlanguage']]['langcode'];
}
return $langcode;
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
\*=====================================================================*/
/**
-* Bug Listing Sorter
-*
-* This class is used to sort bugs based on user-sent options and variables.
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - 2007, Blue Static
-* @version $Revision$
-* @package Bugdar
-*
-*/
+ * Bug Listing Sorter
+ *
+ * This class is used to sort bugs based on user-sent options and variables.
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2004 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
class ListSorter
{
/**
- * Bugsys registry
- * @var object
- * @access private
- */
- var $registry;
+ * Bugsys registry
+ * @var object
+ */
+ private $db;
/**
- * Page name
- * @var string
- * @access public
- */
- var $page = '';
+ * Page name
+ * @var string
+ */
+ public $page = '';
/**
- * Current sort key
- * @var string
- * @access private
- */
- var $sortkey = '';
+ * Current sort key
+ * @var string
+ */
+ public $sortkey = '';
/**
- * Current sort direction
- * @var string
- * @access private
- */
- var $direction = '';
+ * Current sort direction
+ * @var string
+ */
+ private $direction = '';
/**
- * Column array for table heads
- * @var array
- */
- var $columns;
+ * Column array for table heads
+ * @var array
+ */
+ private $columns;
- // ###################################################################
/**
- * Constructor: set the page name
- *
- * @access public
- *
- * @param string File name without the .php extension
- */
- function ListSorter($page)
+ * Constructor: set the page name
+ *
+ * @param string File name without the .php extension
+ */
+ public function __construct($page)
{
- global $bugsys;
- $this->registry = $bugsys;
+ $this->db = BSApp::$db;
$this->page = $page;
- $this->process_incoming();
+ $this->_processIncoming();
}
- // ###################################################################
/**
- * Processes the incoming variables and then sets all the sort order
- * information appropriately
- *
- * @access private
- */
- function process_incoming()
+ * Processes the incoming variables and then sets all the sort order
+ * information appropriately
+ */
+ private function _processIncoming()
{
- $this->sortkey = $this->registry->in['by'];
- if (!$this->fetch_by_text($this->registry->in['by']))
+ $this->sortkey = BSApp::$input->in['by'];
+ if (!self::fetch_by_text(BSApp::$input->in['by']))
{
- $this->sortkey = (isset($this->registry->userinfo['defaultsortkey']) ? $this->registry->userinfo['defaultsortkey'] : $this->registry->options['defaultsortkey']);
+ $this->sortkey = (isset(bugdar::$userinfo['defaultsortkey']) ? bugdar::$userinfo['defaultsortkey'] : bugdar::$options['defaultsortkey']);
}
- $this->direction = $this->registry->in['as'];
+ $this->direction = BSApp::$input->in['as'];
if (!in_array($this->direction, array('asc', 'desc')))
{
- $this->direction = (isset($this->registry->userinfo['defaultsortas']) ? $this->registry->userinfo['defaultsortas'] : $this->registry->options['defaultsortas']);
+ $this->direction = (isset(bugdar::$userinfo['defaultsortas']) ? bugdar::$userinfo['defaultsortas'] : bugdar::$options['defaultsortas']);
}
}
- // ###################################################################
/**
- * Fetch a SQL query to gather bugs with the sort filters applied
- *
- * @access public
- *
- * @param string Additional WHERE clauses in an array
- * @param string A LIMIT clause
- *
- * @return string Compiled SQL query
- */
- function fetch_sql_query($where = null, $limit = null)
+ * Fetch a SQL query to gather bugs with the sort filters applied
+ *
+ * @param string Additional WHERE clauses in an array
+ * @param string A LIMIT clause
+ *
+ * @return string Compiled SQL query
+ */
+ public function fetchSqlQuery($where = null, $limit = null)
{
// this WHERE clause is used for all the queries
$basewhere = "bug.product IN (" . fetch_on_bits('canviewbugs') . ")
- AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . $this->registry->userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ")" .
- (($this->registry->options['hidestatuses'] OR isset($this->registry->userinfo['hidestatuses'])) ? "
- AND bug.status NOT IN (" . ($this->registry->userinfo['hidestatuses'] != '' ? $this->registry->userinfo['hidestatuses'] : $this->registry->options['hidestatuses']) . ")" : "");
+ AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . bugdar::$userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ")" .
+ ((bugdar::$options['hidestatuses'] || isset(bugdar::$userinfo['hidestatuses'])) ? "
+ AND bug.status NOT IN (" . (bugdar::$userinfo['hidestatuses'] != '' ? bugdar::$userinfo['hidestatuses'] : bugdar::$options['hidestatuses']) . ")" : "");
// remap the sort keys to be actual SQL fields
$querykeys = array(
WHERE $basewhere" .
(is_array($where) ? "
AND " . implode("\nAND ", $where) : "") . "
- ORDER BY vote.votefor " . strtoupper($this->direction) . ", vote.voteagainst " . strtoupper($this->fetch_opposite_sort_direction()) . ", bug.$querykeys[lastpost] " . strtoupper($this->direction) . ($limit ? "
+ ORDER BY vote.votefor " . strtoupper($this->direction) . ", vote.voteagainst " . strtoupper($this->fetchOppositeSortDirection()) . ", bug.$querykeys[lastpost] " . strtoupper($this->direction) . ($limit ? "
LIMIT $limit" : "");
break;
default:
return $query;
}
- // ###################################################################
/**
- * Returns the display text for a given sort order key
- *
- * @access public static
- *
- * @param string Sort order key, or FALSE for the array
- * @param bool Permission check the custom fields?
- *
- * @return mixed Display text if param is string, or array of all key=>text if param is NULL
- */
- function fetch_by_text($key, $doPerm = true)
+ * Returns the display text for a given sort order key
+ *
+ * @param string Sort order key, or FALSE for the array
+ * @param bool Permission check the custom fields?
+ *
+ * @return mixed Display text if param is string, or array of all key=>text if param is NULL
+ */
+ public static function fetch_by_text($key, $doPerm = true)
{
- global $bugsys;
-
$keys = array(
'lastpost' => T('Last Post Time'),
'bugid' => T('Bug ID'),
'assignedto' => T('Assigned To')
);
- $fields = self::_fetchCustomFields($doPerm);
+ $fields = self::_fetch_custom_fields($doPerm);
foreach ($fields AS $field)
{
$keys['custom' . $field['fieldid']] = $field['name'];
}
}
- // ###################################################################
/**
- * Returns the display text for a given sort order direction
- *
- * @access public static
- *
- * @param string Sort direction, or FALSE for the array
- *
- * @return mixed Display text if param is string, or array of all key=>text if param is NULL
- */
- function fetch_as_text($key)
+ * Returns the display text for a given sort order direction
+ *
+ * @param string Sort direction, or FALSE for the array
+ *
+ * @return mixed Display text if param is string, or array of all key=>text if param is NULL
+ */
+ public static function fetch_as_text($key)
{
- global $lang;
-
$keys = array(
'desc' => T('Descending'),
'asc' => T('Ascending')
}
}
- // ###################################################################
/**
- * Returns a multi-dimensional array with sort by keys indexing arrays
- * with 'image' and 'href' keys that store the values from
- * fetch_sort_image() and fetch_sort_link(), respectively
- *
- * @access public
- *
- * @param string Extra GET parameters to pass to fetch_sort_link()
- *
- * @return array Array as described above
- */
- function fetch_display_array($params = null)
+ * Returns a multi-dimensional array with sort by keys indexing arrays
+ * with 'image' and 'href' keys that store the values from
+ * fetchSortImage() and fetchSortLink(), respectively
+ *
+ * @param string Extra GET parameters to pass to fetchSortLink()
+ *
+ * @return array Array as described above
+ */
+ public function fetchDisplayArray($params = null)
{
- $return = $this->fetch_by_text(false);
+ $return = self::fetch_by_text(false);
- foreach ($return AS $key => $nil)
+ foreach ($return as $key => $nil)
{
- $return["$key"] = array('image' => ($this->sortkey == $key ? $this->fetch_sort_image() : ''), 'href' => $this->fetch_sort_link($key, $params, true));
+ $return["$key"] = array('image' => ($this->sortkey == $key ? $this->fetchSortImage() : ''), 'href' => $this->fetchSortLink($key, $params, true));
}
return $return;
}
- // ###################################################################
/**
- * Returns the entire <img> tag for the sort arrow
- *
- * @access public
- *
- * @return string HTML <img> tag
- */
- function fetch_sort_image()
+ * Returns the entire <img> tag for the sort arrow
+ *
+ * @return string HTML <img> tag
+ */
+ public function fetchSortImage()
{
- return '<img src="templates/images/arrow_' . $this->fetch_sort_direction() . '.gif" alt="" style="vertical-align: top; border: none" />';
+ return '<img src="templates/images/arrow_' . $this->fetchSortDirection() . '.gif" alt="" style="vertical-align: top; border: none" />';
}
- // ###################################################################
/**
- * Returns the href value for an <a> tag by generating all the necessary
- * bits and concat'ing it onto an extra string of GETs (optional)
- *
- * @access public
- *
- * @param string Sorting key
- * @param string Additional GET parameters
- * @param bool Highlight the current sortkey if that's passed?
- *
- * @return string HREF
- */
- function fetch_sort_link($key, $params = null, $highlight = false)
+ * Returns the href value for an <a> tag by generating all the necessary
+ * bits and concat'ing it onto an extra string of GETs (optional)
+ *
+ * @param string Sorting key
+ * @param string Additional GET parameters
+ * @param bool Highlight the current sortkey if that's passed?
+ *
+ * @return string HREF
+ */
+ public function fetchSortLink($key, $params = null, $highlight = false)
{
if ($params)
{
$params .= '&';
}
- return $this->page . '.php?' . $params . 'by=' . $key . '&as=' . (($this->sortkey == $key AND $highlight) ? $this->fetch_opposite_sort_direction() . '" class="select' : $this->fetch_sort_direction());
+ return $this->page . '.php?' . $params . 'by=' . $key . '&as=' . (($this->sortkey == $key && $highlight) ? $this->fetchOppositeSortDirection() . '" class="select' : $this->fetchSortDirection());
}
- // ###################################################################
/**
- * Returns the OPPOSITE direction to sort when you click on a link
- *
- * @access public
- *
- * @return string Either asc or desc
- */
- function fetch_opposite_sort_direction()
+ * Returns the OPPOSITE direction to sort when you click on a link
+ *
+ * @return string Either asc or desc
+ */
+ public function fetchOppositeSortDirection()
{
if ($this->direction == 'asc')
{
}
}
- // ###################################################################
/**
- * Returns the current sorted direction for the image path
- *
- * @access public
- *
- * @return string Either asc or desc
- */
- function fetch_sort_direction()
+ * Returns the current sorted direction for the image path
+ *
+ * @return string Either asc or desc
+ */
+ public function fetchSortDirection()
{
return $this->direction;
}
- // ###################################################################
/**
- * Returns the HTML code for bug listing table column headers
- *
- * @param bool Include the sort links/image?
- * @param string Additional GET params to pass to fetch_sort_link()
- *
- * @return string HTML code
- */
- function constructColumnHeaders($sortable, $params = null)
+ * Returns the HTML code for bug listing table column headers
+ *
+ * @param bool Include the sort links/image?
+ * @param string Additional GET params to pass to fetchSortLink()
+ *
+ * @return string HTML code
+ */
+ public function constructColumnHeaders($sortable, $params = null)
{
$this->_processColumns();
$names = self::fetch_by_text(false);
$output = '';
- foreach ($this->columns AS $columns)
+ foreach ($this->columns as $columns)
{
$build = array();
- foreach ($columns AS $column)
+ foreach ($columns as $column)
{
- $build[] = ($sortable ? '<a href="' . $this->fetch_sort_link($column, $params, true) . '">' . $names[$column] . '</a>' : $names[$column]);
+ $build[] = ($sortable ? '<a href="' . $this->fetchSortLink($column, $params, true) . '">' . $names[$column] . '</a>' : $names[$column]);
}
- $image = ((in_array($this->sortkey, $columns) AND $sortable) ? $this->fetch_sort_image() : '');
+ $image = ((in_array($this->sortkey, $columns) && $sortable) ? $this->fetchSortImage() : '');
$name = implode(' / ', $build);
- eval('$output .= "' . $this->registry->template->fetch('list_head') . '";');
+
+ $tpl = new BSTemplate('list_head');
+ $tpl->vars = array(
+ 'name' => $name,
+ 'image' => $image
+ );
+ $output .= $tpl->evaluate()->getTemplate();
}
return $output;
}
- // ###################################################################
/**
- * Returns the HTML code for a row of data for the bug listing
- *
- * @param array Bug data array
- * @param string Additional link params
- *
- * @return string Row HTML
- */
+ * Returns the HTML code for a row of data for the bug listing
+ *
+ * @param array Bug data array
+ * @param string Additional link params
+ *
+ * @return string Row HTML
+ */
function constructRow($bug, $params = null)
{
- global $bugsys;
-
$this->_processColumns();
- foreach ($this->columns AS $columns)
+ foreach ($this->columns as $columns)
{
if (sizeof($columns) > 1)
{
$build = array();
- foreach ($columns AS $column)
+ foreach ($columns as $column)
{
$build[] = $this->_processDataForColumn($bug, $column, $params, true);
}
$fields .= "\n\t<td>$data</td>";
}
- eval('$output = "' . $this->registry->template->fetch('trackerhome_bits') . '";');
- return $output;
+ $tpl = new BSTemplate('trackerhome_bits');
+ $tpl->vars = array(
+ 'bug' => $bug,
+ 'fields'=> $fields
+ );
+ return $tpl->evaluate()->getTemplate();
}
- // ###################################################################
/**
- * Handler for special-case column data
- *
- * @param array Bug data
- * @param string Column name
- * @param string Additional URL params
- * @param bool Will this column have multiple data sets?
- *
- * @return string Processed column data
- */
- function _processDataForColumn($bug, $column, $params = null, $multi = false)
+ * Handler for special-case column data
+ *
+ * @param array Bug data
+ * @param string Column name
+ * @param string Additional URL params
+ * @param bool Will this column have multiple data sets?
+ *
+ * @return string Processed column data
+ */
+ private function _processDataForColumn($bug, $column, $params = null, $multi = false)
{
$open = ($multi ? '<div>' : '');
$close = ($multi ? '</div>' : '');
}
}
- // ###################################################################
/**
- * Sets up $this->columns so that the data can be processed more
- * easily
- */
- function _processColumns()
+ * Sets up $this->columns so that the data can be processed more
+ * easily
+ */
+ private function _processColumns()
{
if (is_array($this->columns))
{
$columns = self::fetch_by_text(false);
- $array = (($this->registry->userinfo['userid'] AND is_array($this->registry->userinfo['columnoptions'])) ? $this->registry->userinfo['columnoptions'] : $this->registry->options['columnoptions']);
+ $array = ((bugdar::$userinfo['userid'] && is_array(bugdar::$userinfo['columnoptions'])) ? bugdar::$userinfo['columnoptions'] : bugdar::$options['columnoptions']);
- foreach ($array AS $column => $position)
+ foreach ($array as $column => $position)
{
// the column doesn't exist, or more likely, we don't have permission to view it
if (!isset($columns[$column]))
ksort($this->columns);
}
- // ###################################################################
/**
* Returns an array of all the custom fields that the current user
* has permission to use
*
* @return array
*/
- private static function _fetchCustomFields($doPerm = true)
+ private static function _fetch_custom_fields($doPerm = true)
{
- global $bugsys;
static $fields = array(), $fieldsPerm = array();
- if ($doPerm AND !empty($fieldsPerm))
+ if ($doPerm && !empty($fieldsPerm))
{
return $fieldsPerm;
}
- else if (!$doPerm AND !empty($fields))
+ else if (!$doPerm && !empty($fields))
{
return $fields;
}
if ($doPerm)
{
- $fields_fetch = $bugsys->db->query("
+ $fields_fetch = BSApp::$db->query("
SELECT bugfield.*, MAX(permission.mask) AS mask
FROM " . TABLE_PREFIX . "bugfield AS bugfield
LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission
ON (bugfield.fieldid = permission.fieldid)
WHERE (permission.mask = 2 OR permission.mask = 1)
- AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ")
+ AND permission.usergroupid IN (" . bugdar::$userinfo['usergroupid'] . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ")
GROUP BY (bugfield.fieldid)
");
}
else
{
- $fields_fetch = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield");
+ $fields_fetch = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield");
}
- while ($field = $bugsys->db->fetch_array($fields_fetch))
+ foreach ($fields_fetch as $field)
{
if ($doPerm)
{
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// reason.
$cookieprefix = 'bt';
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
--- /dev/null
+<?php
+/*=====================================================================*\
+|| ###################################################################
+|| # Bugdar
+|| # Copyright (c)2004-2008 Blue Static
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version 2 of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+/**
+ * Returns an email's translated text, for use in sprintf(), given a variable
+ * name
+ *
+ * @param string Name of the email
+ *
+ * @return array Array of translated items (subject, bodyText, bodyHtml)
+ */
+function get_email_text($name)
+{
+ $_emails = array(
+ // welcome email
+ // vars: username, trackertitle
+ 'welcome' => array(
+ 'subject' => sprintf(T('Welcome to %1$s'), bugdar::$options['trackertitle']),
+ 'bodyText' => T('Hi %1$s,
+
+Thank you for taking the time to register at %2$s. We look forward to your contributations to making our products better.
+
+If you have any questions, please don\'t hesitate to contact the webmaster.')
+ ),
+
+ // reset password
+ // vars: username, trackertitle, trackerurl, activation id
+ 'password_reset' => array(
+ 'subject' => sprintf(T('%1$s Password Reset'), bugdar::$options['trackertitle']),
+ 'bodyText' => T('Hi %1$s,
+
+You requested this lost password email at the %2$s bug tracker. To reset your password, simply click the link below (or paste it into your browser window exactly) and enter a new password.
+
+%3$s/login.php?do=recoverpw&activator=%4$s
+
+If you did not request this, do not worry as this notice will expire in 24 hours.')
+ ),
+
+ // account approved and active
+ // vars: username, trackertitle
+ 'account_approved' => array(
+ 'subject' => sprintf(T('Account Approved at %1$s'), bugdar::$options['trackertitle']),
+ 'bodyText' => T('Hi %1$s,
+
+Your account was awaiting moderation at %2$s. Today, an administrator approved your registration and you are now able to use the bug tracker fully.
+
+If you have any questions, please don\'t hesitate to contact the webmaster.')
+ ),
+
+ // activation code
+ // vars: username, trackertitle, trackerurl, userid, activationid
+ 'activate_account' => array(
+ 'subject' => sprintf(T('Welcome to %1$s'), bugdar::$options['trackertitle']),
+ 'bodyText' => T('Hi %1$s,
+
+Welcome to the %2$s tracker. Before you can begin posting bug reports, you\'ll need to activate your account. To do this, please click this link:
+
+%3$s/register.php?do=activate&userid=%4$d&activator=%5$s')
+ ),
+
+ // bug notification
+ // vars: trackertitle, bug.summary
+ // vars: username, trackertitle, bug.summary, bug.id, trackerurl, parts
+ 'notification' => array(
+ 'subject' => T('%1$s Bug Notification - %2$s'),
+ 'bodyText' => T('Hi %1$s,
+
+You are receiving this email because you have opted to get notifications for the %2$s bug tracker.
+
+The bug is "%3$s" (id: %4$d) located at %5$s/showreport.php?bugid=%4$d
+
+Here are the notices:
+###################################################################
+
+%5$s
+
+###################################################################
+If you no longer want to receive email from us, please log into your account and click the "My Controls" tab at the top of the screen to change email preferences.
+
+%5$s')
+ ),
+
+ // assigned to bug
+ // vars
+ 'notice_assigned' => array(
+ 'part' => T('You have been assigned to this bug by %1$s.')
+ ),
+
+ // unassigned from bug
+ // vars: changer.displayname
+ 'notice_unassigned' => array(
+ 'part' => T('You are no longer assigned to this bug, per %1$s\'s changes.')
+ ),
+
+ // status change
+ // vars: new, old
+ 'notice_status' => array(
+ 'part' => T('The status of the bug is now "%1$s", from "%2$s".')
+ ),
+
+ // resolution change
+ // vars: new, old
+ 'notice_resolution' => array(
+ 'part' => T('This bug has been resolved with resolution "%1$s", from "%2$s".')
+ ),
+
+ // duplicates list change
+ // vars: old, new
+ 'notice_duplicates' => array(
+ 'part' => T('The duplicates list has changed from "%1$s" to "%2$s".')
+ ),
+
+ // severity change
+ // vars: old, new
+ 'notice_severity' => array(
+ 'part' => T('The severity has been elevated from "%1$s" to "%2$s".')
+ ),
+
+ // priority change
+ // vars: old, new
+ 'notice_priority' => array(
+ 'part' => T('The priority has been elevatd from "%1$s" to "%2$s".')
+ ),
+
+ // PCV change
+ // vars: old, new
+ 'notice_product' => array(
+ 'part' => T('The product, component, and version combination has changed from "%1$s" to "%2$s".')
+ ),
+
+ // new comment
+ // vars: user, date, comment
+ 'notice_comment' => array(
+ 'part' => T('The following comment was added by %1$s on %2$s:
+============================================
+%3$s
+============================================')
+ ),
+
+ // other change
+ // vars: field, old, new
+ 'notice_other' => array(
+ 'part' => T('The %1$s field changed from "%2$s" to "%3$s".')
+ ),
+
+ // new attachment
+ // vars: username, filename, description, filesize, obsoletes, trackerurl, attachmentid
+ 'notice_attachment' => array(
+ 'part' => T('%1$s has uploaded a new attachment:
+============================================
+File name: %2$s
+Description: %3$s
+File size: %4$d Bytes
+Makes obsolete: %5$s
+View: %6$s/viewattachment.php?attachmentid=%7$d
+============================================')
+ ),
+
+ // new bug
+ // vars: bugid, summary, reporter, product, initial comment
+ 'notice_new_bug' => array(
+ 'part' => T('This bug has been added to the database:
+============================================
+Bug ID: %1$d
+Summary: %2$s
+Reporter: %3$s
+Product/Component/Version: %4$s
+Initial report:
+--------------------------------------------
+%5$s
+--------------------------------------------
+============================================')
+ ),
+
+ // bug notification
+ // vars: trackertitle, bug.summary
+ // vars: displayname, trackertitle, bug.summary, bug.id, trackerurl, parts
+ 'bug_notification' => array(
+ 'subject' => T('%1$s Bug Notification - %2$s'),
+ 'bodyText' => T('Hi %1$s,
+
+You are receiving this email because you have opted to get notifications for the %2$s bug tracker.
+
+The bug is "%3$s" (id: %4$d) located at %4$s/showreport.php?bugid=%5$d
+
+Here are the notices:
+###################################################################
+
+%6$s
+
+###################################################################
+If you no longer want to receive email from us, please log into your account and click the "My Controls" tab at the top of the screen to change email preferences.
+
+%4$s')
+ )
+ );
+
+ if (!isset($_emails[$name]))
+ {
+ throw new Exception('Unknown email template "' . $name . '"');
+ }
+ return $_emails[$name];
+}
+
+?>
\ No newline at end of file
-Subproject commit b4f6983f45d12cd8a8fb5d1193cd9db796606434
+Subproject commit f43a67bd362838ad8fcfe3a7d0532b4d0dbf25c5
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
*/
function construct_option_select($name, $array, $selected = 0, $valuekey = '', $labelkey = '', $includenil = false, $multiple = false)
{
- global $bugsys;
-
if ($multiple)
{
$selected = explode(',', $selected);
return '<select class="input" name="' . $name . ($multiple ? '[]' : '') . '"' . ($multiple ? ' multiple="multiple" size="' . (sizeof($array) < 8 ? sizeof($array) + 1 : 8) . '"' : '') . '>' . implode("\n\t", $opts) . "\r</select>";
}
-// ################### Start construct_user_display ##################
-// $userinfo needs userid, email, displayname, and showemail
+/**
+ * Constructs the user information link
+ *
+ * @param array Userinfo array - requires userid, email, displayname, and showemail values
+ * @param bool Return HTML or just a string?
+ * @return string
+ */
function construct_user_display($userinfo, $html = true)
{
- global $bugsys;
-
if (!$userinfo['userid'])
{
$userinfo['displayname'] = T('Guest');
if ($html)
{
- eval('$username = "' . $bugsys->template->fetch('username_display') . '";');
+ $tpl = new BSTemplate('username_display');
+ $tpl->vars = array('userinfo' => $userinfo);
+ $username = $tpl->evaluate()->getTemplate();
}
else
{
// short-hand for bitwise &
function can_perform($bitmask, $productid = 0, $userinfo = null)
{
- global $bugsys;
-
// masks that aren't product-specific
static $inspecific = array(
'cansearch',
if ($userinfo == null)
{
- $userinfo =& $bugsys->userinfo;
+ $userinfo =& bugdar::$userinfo;
}
- $permissions =& $bugsys->datastore['permission'];
+ $permissions =& bugdar::$datastore['permission'];
- if (!isset($bugsys->permissions["$bitmask"]))
+ if (!isset(bugdar::$permissions["$bitmask"]))
{
trigger_error('Invalid bitmask "' . $bitmask . '" specified for can_perform() [includes/functions.php]', E_USER_WARNING);
}
if ($productid AND !in_array($bitmask, $inspecific))
{
- $verdict = (isset($permissions["$userinfo[usergroupid]"]["$productid"]) ? ($permissions["$userinfo[usergroupid]"]["$productid"] & $bugsys->permissions["$bitmask"]) : ($userinfo['permissions'] & $bugsys->permissions["$bitmask"]));
+ $verdict = (isset($permissions["$userinfo[usergroupid]"]["$productid"]) ? ($permissions["$userinfo[usergroupid]"]["$productid"] & bugdar::$permissions["$bitmask"]) : ($userinfo['permissions'] & bugdar::$permissions["$bitmask"]));
foreach ($userinfo['groupids'] AS $group)
{
if (isset($permissions["$group"]["$productid"]))
{
- $verdict |= ($permissions["$group"]["$productid"] & $bugsys->permissions["$bitmask"]);
+ $verdict |= ($permissions["$group"]["$productid"] & bugdar::$permissions["$bitmask"]);
}
}
- $bugsys->debug("verdict* on can_perform($bitmask, $productid, $userinfo[userid]) = $verdict");
+ BSApp::debug("verdict* on can_perform($bitmask, $productid, $userinfo[userid]) = $verdict");
return $verdict;
}
- $bugsys->debug("verdict on can_perform($bitmask, $productid, $userinfo[userid]) = " . ($userinfo['permissions'] & $bugsys->permissions["$bitmask"]));
- return ($userinfo['permissions'] & $bugsys->permissions["$bitmask"]);
+ BSApp::debug("verdict on can_perform($bitmask, $productid, $userinfo[userid]) = " . ($userinfo['permissions'] & bugdar::$permissions["$bitmask"]));
+ return ($userinfo['permissions'] & bugdar::$permissions["$bitmask"]);
}
-// ###################################################################
/**
-* Runs through a given datastore item and creates a series of <select>
-* options.
-*
-* @access public
-*
-* @param string Datastore name
-* @param string Array index for the label
-* @param string Array index for the value
-* @param mixed The selected value(s)
-* @param bool Include a blank option? TRUE will set a null value, FALSE turns it off, anything else is used as the value for the blank option
-* @param bool Generate it using admin printers?
-*
-* @return string Unelss in admin mode, returns the constructed options
-*/
+ * Runs through a given datastore item and creates a series of <select>
+ * options.
+ *
+ * @access public
+ *
+ * @param string Datastore name
+ * @param string Array index for the label
+ * @param string Array index for the value
+ * @param mixed The selected value(s)
+ * @param bool Include a blank option? TRUE will set a null value, FALSE turns it off, anything else is used as the value for the blank option
+ * @param bool Generate it using admin printers?
+ *
+ * @return string Unelss in admin mode, returns the constructed options
+ */
function construct_datastore_select($datastore, $labelname, $valuename, $selectedvalue = 0, $includeblank = false, $adminmode = false)
{
- global $bugsys;
-
if ($adminmode)
{
global $admin;
}
else
{
- $label = '';
- $value = $newval;
- $selected = ((!$selectedvalue OR (is_array($selectedvalue) AND in_array($newval, $selectedvalue))) ? true : false);
- eval('$select .= "' . $bugsys->template->fetch('selectoption') . '";');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'label' => '',
+ 'value' => $newval,
+ 'selected' => (!$selectedvalue || (is_array($selectedvalue) && in_array($newval, $selectedvalue)))
+ );
+ $select .= $tpl->evaluate()->getTemplate();
}
}
- foreach ($bugsys->datastore["$datastore"] AS $item)
+ foreach (bugdar::$datastore["$datastore"] AS $item)
{
$label = $item["$labelname"];
$value = $item["$valuename"];
}
else
{
- eval('$select .= "' . $bugsys->template->fetch('selectoption') . '";');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'label' => $label,
+ 'value' => $value,
+ 'selected' => $selected
+ );
+ $select .= $tpl->evaluate()->getTemplate();
}
}
// ################## Start construct_custom_fields ##################
function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefault = false, $searchMode = false)
{
- global $bugsys;
static $fields;
if (!is_array($fields))
{
$fields = array();
- $fields_fetch = $bugsys->db->query("
+ $fields_fetch = BSApp::$db->query("
SELECT bugfield.*, MAX(permission.mask) AS mask
FROM " . TABLE_PREFIX . "bugfield AS bugfield
LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission
ON (bugfield.fieldid = permission.fieldid)
WHERE (permission.mask = 2 OR permission.mask = 1)
- AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ")
+ AND permission.usergroupid IN (" . bugdar::$userinfo['usergroupid'] . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ")
GROUP BY (bugfield.fieldid)
");
- while ($field = $bugsys->db->fetch_array($fields_fetch))
+ foreach ($fields_fetch as $field)
{
$fields["$field[fieldid]"] = $field;
}
if (!is_null($bug["custom$field[fieldid]"]))
{
- $bugsys->debug("not null: $field[fieldid]");
+ BSApp::debug("not null: $field[fieldid]");
$value = $bug["custom$field[fieldid]"];
}
else
switch ($field['type'])
{
case 'input_text':
- eval('$tempfield = "' . $bugsys->template->fetch('bugfield_input_text') . '";');
+ $tpl = new BSTemplate('bugfield_input_text');
+ $tpl->vars = array(
+ 'field' => $field,
+ 'value' => $value
+ );
+ $tempfield = $tpl->evaluate()->getTemplate();
break;
case 'input_checkbox':
- $selected = ($value ? ' checked="checked"' : '');
- eval('$tempfield = "' . $bugsys->template->fetch('bugfield_input_checkbox') . '";');
+ $tpl = new BSTemplate('bugfield_input_checkbox');
+ $tpl->vars = array(
+ 'field' => $field,
+ 'searchMode' => $searchMode,
+ 'selected' => ($value ? ' checked="checked"' : '')
+ );
+ $tempfield = $tpl->evaluate()->getTemplate();
break;
case 'select_single':
$selects = unserialize($field['selects']);
$value = trim($value);
- $options = '';
+ $tpl = new BSTemplate('bugfield_select_single_option');
+ $tpl->vars = array(
+ 'id' => -1,
+ 'select' => '',
+ 'selected' => ((!$field['usedefault'] && !trim($value)) ? ' selected="selected"' : '')
+ );
+ $options = $tpl->evaluate()->getTemplate();
- $id = -1;
- $select = '';
- if (!$field['usedefault'] AND !trim($value))
- {
- $selected = ' selected="selected"';
- }
- else
+ foreach ($selects as $id => $select)
{
- $selected = '';
+ $tpl = new BSTemplate('bugfield_select_single_option');
+ $tpl->vars = array(
+ 'id' => $id,
+ 'select' => stripslashes(trim($select)),
+ 'selected' => (($select == $value || ($field['usedefault'] && $id == 0)) ? ' selected="selected"' : '')
+ );
+ $options .= $tpl->evaluate()->getTemplate();
}
- eval('$options .= "' . $bugsys->template->fetch('bugfield_select_single_option') . '";');
- foreach ($selects AS $id => $select)
- {
- $selected = '';
- $select = stripslashes(trim($select));
- if ($select == $value)
- {
- $selected = ' selected="selected"';
- }
- else if ($field['usedefault'] AND $id == 0)
- {
- $selected = ' selected="selected"';
- }
- eval('$options .= "' . $bugsys->template->fetch('bugfield_select_single_option') . '";');
- }
- eval('$tempfield = "' . $bugsys->template->fetch('bugfield_select_single') . '";');
+ $tpl = new BSTemplate('bugfield_select_single');
+ $tpl->vars = array(
+ 'field' => $field,
+ 'options' => $options
+ );
+ $tempfield = $tpl->evaluate()->getTemplate();
break;
}
}
else
{
- $bugsys->debug('mask 1 processing');
+ BSApp::debug('mask 1 processing');
if (is_null($bug["custom$field[fieldid]"]))
{
- $bugsys->debug("is null: $field[fieldid]");
+ BSApp::debug("is null: $field[fieldid]");
if ($field['type'] == 'select_single')
{
if ($field['usedefault'])
$value = ($value ? 'True' : 'False');
}
$field['value'] = $value;
- eval('$tempfield = "' . $bugsys->template->fetch('bugfield_static_text') . '";');
+
+ $tpl = new BSTemplate('bugfield_static_text');
+ $tpl->vars = array('field' => $field);
+ $tempfield = $tpl->evaluate()->getTemplate();
}
$fieldbits[] = $tempfield;
}
*/
function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode = false)
{
- global $bugsys;
-
if (!$inputdata)
{
- $inputdata =& $bugsys->in;
+ $inputdata = &BSApp::$input->in;
}
- $fields = $bugsys->db->query("
+ $fields = BSApp::$db->query("
SELECT bugfield.*, MAX(permission.mask) AS mask
FROM " . TABLE_PREFIX . "bugfield AS bugfield
LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission
ON (bugfield.fieldid = permission.fieldid)
WHERE permission.mask = 2
- AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ")
+ AND permission.usergroupid IN (" . bugdar::$userinfo['usergroupid'] . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ")
GROUP BY (bugfield.fieldid)
");
- while ($field = $bugsys->db->fetch_array($fields))
+ foreach ($fields as $field)
{
$fieldname = "custom$field[fieldid]";
// ####################### Start fetch_on_bits #######################
function fetch_on_bits($mask, $userinfo = null)
{
- global $bugsys;
-
if ($userinfo == null)
{
- $userinfo =& $bugsys->userinfo;
+ $userinfo =& bugdar::$userinfo;
}
$onbits = array();
$groups[] = $usergroupid;
// product-inspecific work
- if (is_array($bugsys->datastore['product']))
+ if (is_array(bugdar::$datastore['product']))
{
foreach ($groups AS $groupid)
{
// we only need to do this so long as there's no onbits array because this isn't product specific
- if (sizeof($onbits) == 0 AND $bugsys->datastore['usergroup']["$groupid"]['permissions'] & $bugsys->permissions["$mask"])
+ if (sizeof($onbits) == 0 AND bugdar::$datastore['usergroup']["$groupid"]['permissions'] & bugdar::$permissions["$mask"])
{
- foreach ($bugsys->datastore['product'] AS $id => $product)
+ foreach (bugdar::$datastore['product'] AS $id => $product)
{
$onbits["$id"] = $id;
}
// product specific work
foreach ($groups AS $groupid)
{
- if (is_array($bugsys->datastore['permission']["$groupid"]))
+ if (is_array(bugdar::$datastore['permission']["$groupid"]))
{
- foreach ($bugsys->datastore['permission']["$groupid"] AS $productid => $bit)
+ foreach (bugdar::$datastore['permission']["$groupid"] AS $productid => $bit)
{
- if ($bit & $bugsys->permissions["$mask"])
+ if ($bit & bugdar::$permissions["$mask"])
{
$explicit["$productid"] = $productid;
$onbits["$productid"] = $productid;
return implode(',', $onbits);
}
-// #################### Start isso_pre_parse_hook ####################
-// the pre-parse hook for ISSO's template engine
+/**
+ * Pre-parse hook for BSTemplate class. This merely substitutes help links
+ *
+ * @param string Template
+ * @return string
+ */
function isso_pre_parse_hook($template)
{
- $template = preg_replace('#\$help\[(.*)\]#', '" . fetch_help_link("\1") . "', $template);
+ $template = preg_replace('#\$help\[(.*)\]#', '<?php echo fetch_help_link("\1") ?>', $template);
return $template;
}
-// ###################### Start fetch_help_link ######################
-// returns a prepared link to insert into templates that opens up a
-// help popup in the user-end
+/**
+ * Returns the HTML used to generate a help link for a given topic
+ *
+ * @param string Topic name
+ * @return string
+ */
function fetch_help_link($topic)
{
- global $bugsys;
+ $tpl = new BSTemplate('help_link');
+ $tpl->vars = array('topic' => $topic);
- if (isset($bugsys->datastore['help']["$topic"]))
+ if (isset(bugdar::$datastore['help']["$topic"]))
{
- eval('$temp = "' . $bugsys->template->fetch('help_link') . '";');
- return $temp;
+ return $tpl->evaluate()->getTemplate();
}
else
{
- if ($bugsys->debug)
+ if (BSApp::get_debug())
{
return "[[INVALID TOPIC: $topic]]";
}
// do we want this?
else if (null == 1)
{
- return eval('$temp = "' . $bugsys->template->fetch('help_link') . '";');
+ return $tpl->evaluate()->getTemplate();
}
}
}
*/
function fetch_guest_user()
{
- global $bugsys;
-
return array(
'usergroupid' => 1,
'groupids' => array(),
'email' => '',
'displayname' => '',
'showcolors' => 1,
- 'permissions' => $bugsys->datastore['usergroup'][1]['permissions'],
- 'displaytitle' => $bugsys->datastore['usergroup'][1]['displaytitle'],
- 'timezone' => $bugsys->options['defaulttimezone']
+ 'permissions' => bugdar::$datastore['usergroup'][1]['permissions'],
+ 'displaytitle' => bugdar::$datastore['usergroup'][1]['displaytitle'],
+ 'timezone' => bugdar::$options['defaulttimezone']
);
}
*/
function check_bug_permissions($bug, $userinfo = null)
{
- global $bugsys;
if ($userinfo == null)
{
- $userinfo = $bugsys->userinfo;
+ $userinfo = bugdar::$userinfo;
}
- $bugsys->debug("checking permissions for $userinfo[userid] on bug $bug[bugid]");
+ BSApp::debug("checking permissions for $userinfo[userid] on bug $bug[bugid]");
- $bugsys->debug('*** START VERBOSE CHECK ***');
+ BSApp::debug('*** START VERBOSE CHECK ***');
- $bugsys->debug('* !can_perform(canviewbugs, $bug[product], $userinfo) = ' . (int)(!can_perform('canviewbugs', $bug['product'], $userinfo)));
- $bugsys->debug('* $bug[hidden] = ' . (int)$bug['hidden']);
- $bugsys->debug('* $userinfo[userid] (' . $userinfo['userid'] . ') == $bug[userid] (' . $bug['userid'] . ') = ' . (int)($userinfo['userid'] == $bug['userid']));
- $bugsys->debug('* can_perform(canviewownhidden, $bug[product], $userinfo) = ' . (int)(!!can_perform('canviewownhidden', $bug['product'], $userinfo)));
- $bugsys->debug('* can_perform(canviewhidden, $bug[product], $userinfo) = ' . (int)(!!can_perform('canviewhidden', $bug['product'], $userinfo)));
- $bugsys->debug('* !$bug[hidden] = ' . (int)(!$bug['hidden']));
+ BSApp::debug('* !can_perform(canviewbugs, $bug[product], $userinfo) = ' . (int)(!can_perform('canviewbugs', $bug['product'], $userinfo)));
+ BSApp::debug('* $bug[hidden] = ' . (int)$bug['hidden']);
+ BSApp::debug('* $userinfo[userid] (' . $userinfo['userid'] . ') == $bug[userid] (' . $bug['userid'] . ') = ' . (int)($userinfo['userid'] == $bug['userid']));
+ BSApp::debug('* can_perform(canviewownhidden, $bug[product], $userinfo) = ' . (int)(!!can_perform('canviewownhidden', $bug['product'], $userinfo)));
+ BSApp::debug('* can_perform(canviewhidden, $bug[product], $userinfo) = ' . (int)(!!can_perform('canviewhidden', $bug['product'], $userinfo)));
+ BSApp::debug('* !$bug[hidden] = ' . (int)(!$bug['hidden']));
- $bugsys->debug('*** END PERMISSIONS CHECK ***');
+ BSApp::debug('*** END PERMISSIONS CHECK ***');
if
(
)
)
{
- $bugsys->debug('*** DONE WITH REAL CALLS ***');
+ BSApp::debug('*** DONE WITH REAL CALLS ***');
return false;
}
- $bugsys->debug('*** DONE WITH REAL CALLS ***');
+ BSApp::debug('*** DONE WITH REAL CALLS ***');
return true;
}
* @param array Bug array with data fit for display
*/
function ProcessBugDataForDisplay($bug, $color = '')
-{
- global $bugsys;
-
- $bug['hiddendisplay'] = ($bug['hidden'] AND (can_perform('canviewhidden', $bug['product']) OR (can_perform('canviewownhidden') AND $bug['userid'] == $bugsys->userinfo['userid'])));
-
- $bug['bgcolor'] = ($bugsys->userinfo['showcolors'] ? $bugsys->datastore['status']["$bug[status]"]['color'] : $color);
- $bug['product'] = $bugsys->datastore['product']["$bug[product]"]['title'];
- $bug['version'] = $bugsys->datastore['version']["$bug[version]"]['version'];
- $bug['component'] = $bugsys->datastore['component']["$bug[component]"]['title'];
- $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status'];
- $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution'];
- $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority'];
- $bug['severity'] = $bugsys->datastore['severity']["$bug[severity]"]['severity'];
- $bug['assignedto'] = ((empty($bug['assignedto']) OR !isset($bugsys->datastore['assignto']["$bug[assignedto]"])) ? '' : construct_user_display($bugsys->datastore['assignto']["$bug[assignedto]"]));
+{
+ $bug['hiddendisplay'] = ($bug['hidden'] AND (can_perform('canviewhidden', $bug['product']) OR (can_perform('canviewownhidden') AND $bug['userid'] == bugdar::$userinfo['userid'])));
+
+ $bug['bgcolor'] = (bugdar::$userinfo['showcolors'] ? bugdar::$datastore['status']["$bug[status]"]['color'] : $color);
+ $bug['product'] = bugdar::$datastore['product']["$bug[product]"]['title'];
+ $bug['version'] = bugdar::$datastore['version']["$bug[version]"]['version'];
+ $bug['component'] = bugdar::$datastore['component']["$bug[component]"]['title'];
+ $bug['status'] = bugdar::$datastore['status']["$bug[status]"]['status'];
+ $bug['resolution'] = bugdar::$datastore['resolution']["$bug[resolution]"]['resolution'];
+ $bug['priority'] = bugdar::$datastore['priority']["$bug[priority]"]['priority'];
+ $bug['severity'] = bugdar::$datastore['severity']["$bug[severity]"]['severity'];
+ $bug['assignedto'] = ((empty($bug['assignedto']) OR !isset(bugdar::$datastore['assignto']["$bug[assignedto]"])) ? '' : construct_user_display(bugdar::$datastore['assignto']["$bug[assignedto]"]));
$bug['lastposttime'] = ($bug['hiddendisplay'] ? $bug['hiddenlastposttime'] : $bug['lastposttime']);
$bug['lastpost'] = ($bug['hiddendisplay'] ? $bug['hiddenlastpostbyname'] : $bug['lastpostbyname']);
- $bug['lastposttime'] = $bugsys->datef->format($bugsys->options['dateformat'], $bug['lastposttime']);
+ $bug['lastposttime'] = BSApp::$date->format(bugdar::$options['dateformat'], $bug['lastposttime']);
return $bug;
}
-// ###################################################################
-/**
-* Loads the pagination module and sets all of the appropriate options
-* for it
-*
-* @access public
-*/
-function LoadPaginationFramework()
-{
- global $bugsys;
-
- $bugsys->load('pagination', 'pagination', true);
- $bugsys->pagination->setDefaultPerPage($bugsys->options['defaultpp']);
- $bugsys->pagination->setMaxPerPage($bugsys->options['maxpp']);
- $bugsys->pagination->setPageLinks($bugsys->options['pagelinks']);
- $bugsys->pagination->setPageVar('p');
- $bugsys->pagination->setPerPageVar('pp');
- $bugsys->pagination->setBitProcessor('PageNavigatorBitCallback');
- $bugsys->pagination->setNavigatorProcessor('PageNavigatorCallback');
- $bugsys->pagination->processIncomingData();
-}
-
-// ###################################################################
-/**
-* Callback function for the Pagination->BitProcessor()
-*
-* @param string Base link
-* @param bool Do not show this as a link
-* @param integer Page number
-* @param object Page navigator framework
-*
-* @return string Processed HTML
-*/
-function PageNavigatorBitCallback($baselink, $nolink, $number, $paginator)
-{
- global $bugsys;
- eval('$return = "' . $bugsys->template->fetch('pagenav_bit') . '";');
- return $return;
-}
-
-// ###################################################################
-/**
-* Callback function for the Pagination->NavigatorProcessor()
-*
-* @param string Base URL
-* @param integer Next page number
-* @param integer Previous page number
-* @param array Show information
-* @param string Individual page bits
-* @param object Page navigator framework
-*
-* @return string Processed HTML
-*/
-function PageNavigatorCallback($baselink, $nextpage, $prevpage, $show, $pagebits, $paginator)
-{
- global $bugsys;
- eval('$return = "' . $bugsys->template->fetch('pagenav') . '";');
- return $return;
-}
-
// ###################################################################
/**
* Determines the correct permissions of the user. This is especially
*/
function FetchUserPermissions(&$user)
{
- global $bugsys;
-
- $perms = (int)$bugsys->datastore['usergroup']["$user[usergroupid]"]['permissions'];
+ $perms = (int)bugdar::$datastore['usergroup']["$user[usergroupid]"]['permissions'];
if (!is_array($user['groupids']))
{
- $user['groupids'] = explode(',', $bugsys->userinfo['groupids']);
+ $user['groupids'] = explode(',', bugdar::$userinfo['groupids']);
}
- $user['groupids'] = $bugsys->funct->array_strip_empty($user['groupids']);
+ $user['groupids'] = BSFunctions::array_strip_empty($user['groupids']);
foreach ($user['groupids'] AS $group)
{
- $perms |= (int)$bugsys->datastore['usergroup']["$group"]['permissions'];
+ $perms |= (int)bugdar::$datastore['usergroup']["$group"]['permissions'];
}
return $perms;
return '../locale/' . $locale . '/emails/' . $name;
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################### Start build_languages ######################
function build_languages()
{
- global $bugsys;
-
- $languages = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "language");
- while ($language = $bugsys->db->fetch_array($languages))
+ $languages = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "language");
+ foreach ($languages as $language)
{
$tempstore["$language[languageid]"] = $language;
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing the language cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('language', '" . $bugsys->escape(serialize($tempstore)) . "')"
+ VALUES ('language', '" . BSApp::$input->escape(serialize($tempstore)) . "')"
);
- $bugsys->datastore['language'] = $tempstore;
+ bugdar::$datastore['language'] = $tempstore;
}
// ####################### Start build_settings ######################
function build_settings()
{
- global $bugsys;
-
- $settings = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "setting");
- while ($setting = $bugsys->db->fetch_array($settings))
+ $settings = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "setting");
+ foreach ($settings as $setting)
{
$options["$setting[varname]"] = $setting['value'];
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing the setting cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('setting', '" . $bugsys->escape(serialize($options)) . "')"
+ VALUES ('setting', '" . BSApp::$input->escape(serialize($options)) . "')"
);
- $bugsys->datastore['setting'] = $options;
+ bugdar::$datastore['setting'] = $options;
}
// ###################### Start build_usergroups #####################
function build_usergroups()
{
- global $bugsys;
-
- $usergroups = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "usergroup");
- while ($usergroup = $bugsys->db->fetch_array($usergroups))
+ $usergroups = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "usergroup");
+ foreach ($usergroups as $usergroup)
{
$groups["$usergroup[usergroupid]"] = $usergroup;
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing usergroup cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('usergroup', '" . $bugsys->escape(serialize($groups)) . "')"
+ VALUES ('usergroup', '" . BSApp::$input->escape(serialize($groups)) . "')"
);
- $bugsys->datastore['usergroup'] = $groups;
+ bugdar::$datastore['usergroup'] = $groups;
}
// ####################### Start build_statuses ######################
function build_statuses()
{
- global $bugsys;
-
- $statuses = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "status ORDER BY displayorder ASC");
- while ($status = $bugsys->db->fetch_array($statuses))
+ $statuses = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "status ORDER BY displayorder ASC");
+ foreach ($statuses as $status)
{
$tempstore["$status[statusid]"] = $status;
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing status cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('status', '" . $bugsys->escape(serialize($tempstore)) . "')"
+ VALUES ('status', '" . BSApp::$input->escape(serialize($tempstore)) . "')"
);
- $bugsys->datastore['status'] = $tempstore;
+ bugdar::$datastore['status'] = $tempstore;
}
// ###################### Start build_severities #####################
function build_severities()
{
- global $bugsys;
-
- $severities = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "severity ORDER BY displayorder ASC");
- while ($severity = $bugsys->db->fetch_array($severities))
+ $severities = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "severity ORDER BY displayorder ASC");
+ foreach ($severities as $severity)
{
$tempstore["$severity[severityid]"] = $severity;
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing severity cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('severity', '" . $bugsys->escape(serialize($tempstore)) . "')"
+ VALUES ('severity', '" . BSApp::$input->escape(serialize($tempstore)) . "')"
);
- $bugsys->datastore['severity'] = $tempstore;
+ bugdar::$datastore['severity'] = $tempstore;
}
// ###################### Start build_priorities #####################
function build_priorities()
{
- global $bugsys;
-
- $priorities = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "priority ORDER BY displayorder ASC");
- while ($priority = $bugsys->db->fetch_array($priorities))
+ $priorities = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "priority ORDER BY displayorder ASC");
+ foreach ($priorities as $priority)
{
$tempstore["$priority[priorityid]"] = $priority;
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing priority cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('priority', '" . $bugsys->escape(serialize($tempstore)) . "')"
+ VALUES ('priority', '" . BSApp::$input->escape(serialize($tempstore)) . "')"
);
- $bugsys->datastore['priority'] = $tempstore;
+ bugdar::$datastore['priority'] = $tempstore;
}
// ###################### Start build_assignedto #####################
function build_assignedto()
{
- global $bugsys;
-
// determine the groups that are assignable
$ids = $exprs = array();
- foreach ($bugsys->datastore['usergroup'] AS $id => $group)
+ foreach (bugdar::$datastore['usergroup'] AS $id => $group)
{
- if ($group['permissions'] & $bugsys->permissions['canbeassignedto'])
+ if ($group['permissions'] & bugdar::$permissions['canbeassignedto'])
{
$ids[] = $id;
$exprs[] = "FIND_IN_SET($id, groupids)";
$ids = implode(',', $ids);
$exprs = implode(' OR ', $exprs);
- $users = $bugsys->db->query("
+ $users = BSApp::$db->query("
SELECT email, displayname, userid, showemail
FROM " . TABLE_PREFIX . "user AS user
WHERE usergroupid IN ($ids) OR $exprs"
);
- while ($user = $bugsys->db->fetch_array($users))
+ foreach ($users as $user)
{
$devs["$user[userid]"] = $user;
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing developer / assign to cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('assignto', '" . $bugsys->escape(serialize($devs)) . "')"
+ VALUES ('assignto', '" . BSApp::$input->escape(serialize($devs)) . "')"
);
- $bugsys->datastore['assignto'] = $devs;
+ bugdar::$datastore['assignto'] = $devs;
}
// ##################### Start build_resolutions #####################
function build_resolutions()
{
- global $bugsys;
-
- $resolutions = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "resolution ORDER BY displayorder ASC");
- while ($resolution = $bugsys->db->fetch_array($resolutions))
+ $resolutions = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "resolution ORDER BY displayorder ASC");
+ foreach ($resolutions as $resolution)
{
$tempstore["$resolution[resolutionid]"] = $resolution;
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing resolution cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('resolution', '" . $bugsys->escape(serialize($tempstore)) . "')"
+ VALUES ('resolution', '" . BSApp::$input->escape(serialize($tempstore)) . "')"
);
- $bugsys->datastore['resolution'] = $tempstore;
+ bugdar::$datastore['resolution'] = $tempstore;
}
// ####################### Start build_versions ######################
function build_versions()
{
- global $bugsys;
-
- $versions = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "version ORDER BY displayorder ASC");
- while ($version = $bugsys->db->fetch_array($versions))
+ $versions = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "version ORDER BY displayorder ASC");
+ foreach ($versions as $version)
{
$tempstore["$version[versionid]"] = $version;
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing version cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('version', '" . $bugsys->escape(serialize($tempstore)) . "')"
+ VALUES ('version', '" . BSApp::$input->escape(serialize($tempstore)) . "')"
);
- $bugsys->datastore['version'] = $tempstore;
+ bugdar::$datastore['version'] = $tempstore;
}
// ####################### Start build_products ######################
function build_products()
{
- global $bugsys;
-
- $products = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "product ORDER BY displayorder ASC");
- while ($product = $bugsys->db->fetch_array($products))
+ $products = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "product ORDER BY displayorder ASC");
+ foreach ($products as $product)
{
if ($product['parentid'])
{
}
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing product / component cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
VALUES
- ('product', '" . $bugsys->escape(serialize($tempstore['product'])) . "'),
- ('component', '" . $bugsys->escape(serialize($tempstore['component'])) . "')"
+ ('product', '" . BSApp::$input->escape(serialize($tempstore['product'])) . "'),
+ ('component', '" . BSApp::$input->escape(serialize($tempstore['component'])) . "')"
);
- $bugsys->datastore['product'] = $tempstore['product'];
- $bugsys->datastore['component'] = $tempstore['component'];
+ bugdar::$datastore['product'] = $tempstore['product'];
+ bugdar::$datastore['component'] = $tempstore['component'];
}
// ##################### Start build_permissions #####################
function build_permissions()
{
- global $bugsys;
-
- $permissions = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "permission ORDER BY usergroupid, productid");
- while ($permission = $bugsys->db->fetch_array($permissions))
+ $permissions = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "permission ORDER BY usergroupid, productid");
+ foreach ($permissions as $permission)
{
$tempstore["$permission[usergroupid]"]["$permission[productid]"] = $permission['mask'];
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing permissions cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('permission', '" . $bugsys->escape(serialize($tempstore)) . "')"
+ VALUES ('permission', '" . BSApp::$input->escape(serialize($tempstore)) . "')"
);
- $bugsys->datastore['permission'] = $tempstore;
+ bugdar::$datastore['permission'] = $tempstore;
}
// ##################### Start build_automations ####################
function build_automations()
{
- global $bugsys;
-
- $automations = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "automation ORDER BY name ASC");
- while ($automation = $bugsys->db->fetch_array($automations))
+ $automations = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "automation ORDER BY name ASC");
+ foreach ($automations as $automation)
{
$actions["$automation[actionid]"] = $automation;
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing automation cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('automation', '" . $bugsys->escape(serialize($actions)) . "')"
+ VALUES ('automation', '" . BSApp::$input->escape(serialize($actions)) . "')"
);
- $bugsys->datastore['automation'] = $actions;
+ bugdar::$datastore['automation'] = $actions;
}
// ###################### Start build_user_help ######################
function build_user_help()
{
- global $bugsys;
-
// custom field descriptions
- $descriptions = $bugsys->db->query("SELECT fieldid, name, description FROM " . TABLE_PREFIX . "bugfield");
- while ($field = $bugsys->db->fetch_array($descriptions))
+ $descriptions = BSApp::$db->query("SELECT fieldid, name, description FROM " . TABLE_PREFIX . "bugfield");
+ foreach ($descriptions as $field)
{
$help["field$field[fieldid]"] = array('title' => $field['name'], 'body' => $field['description']);
}
// standard help texts
- $texts = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "fieldhelp");
- while ($field = $bugsys->db->fetch_array($texts))
+ $texts = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "fieldhelp");
+ foreach ($texts as $field)
{
$help["$field[keystring]"] = $field;
}
- $bugsys->db->query("
+ BSApp::$db->query("
### replacing user help cache ###
REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
- VALUES ('help', '" . $bugsys->escape(serialize($help)) . "')"
+ VALUES ('help', '" . BSApp::$input->escape(serialize($help)) . "')"
);
- $bugsys->datastore['help'] = $help;
+ bugdar::$datastore['help'] = $help;
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-// ###################################################################
/**
-* Constructs a massive <select> form element to create non-valid XHTML
-* for product selection. We have to use nested <optgroup>s (invalid)
-* because certain browsers (Safari) do not support <option disabled>,
-* which is how I want to implement components.
-*
-* @param string Permission action to verify against for a product
-* @param string Selection
-* @param bool Include obsolete versions?
-*
-* @return string A large blob of <select> HTML
-*/
-function ConstructProductSelect($action = 'canviewbugs', $select = null, $obsolete = true)
+ * Constructs a massive <select> form element to create non-valid XHTML
+ * for product selection. We have to use nested <optgroup>s (invalid)
+ * because certain browsers (Safari) do not support <option disabled>,
+ * which is how I want to implement components.
+ *
+ * @param string Permission action to verify against for a product
+ * @param string Selection
+ * @param bool Include obsolete versions?
+ *
+ * @return string A large blob of <select> HTML
+ */
+function construct_product_select($action = 'canviewbugs', $select = null, $obsolete = true)
{
- global $bugsys;
-
$output = '';
// index all of the components by parent and ID
$components = array();
- if (is_array($bugsys->datastore['component']))
+ if (is_array(bugdar::$datastore['component']))
{
- foreach ($bugsys->datastore['component'] AS $id => $prod)
+ foreach (bugdar::$datastore['component'] as $id => $prod)
{
$components["$prod[parentid]"]["$id"] = $prod;
}
}
// these are products
- foreach ($bugsys->datastore['product'] AS $productid => $product)
+ foreach (bugdar::$datastore['product'] as $productid => $product)
{
- if (!can_perform($action, $product['productid']) OR !can_perform('canviewbugs', $product['productid']))
+ if (!can_perform($action, $product['productid']) || !can_perform('canviewbugs', $product['productid']))
{
continue;
}
- if ($versions = ConstructVersionSelect($productid, $select, $obsolete))
+ if ($versions = construct_version_select($productid, $select, $obsolete))
{
- $output .= ConstructOptionGroup($product['title'], $versions);
+ $output .= construct_option_group($product['title'], $versions);
}
// these are components
if ($components["$productid"])
{
- foreach ($components["$productid"] AS $componentid => $component)
+ foreach ($components["$productid"] as $componentid => $component)
{
- $output .= ConstructOptionGroup($product['title'] . '/' . $component['title'], ConstructVersionSelect($componentid, $select, $obsolete));
+ $output .= construct_option_group($product['title'] . '/' . $component['title'], construct_version_select($componentid, $select, $obsolete));
}
}
}
return $output;
}
-// ###################################################################
/**
-* Constructs a string of HTML <option>s for a given product ID. This
-* will always include global versions and inherited versions (if the
-* passed ID is that of a component).
-*
-* @param integer Product ID
-* @param string Selection
-* @param bool Include obsolete versions?
-*
-* @return string Constructed <option> HTML
-*/
-function ConstructVersionSelect($productid, $select, $obsolete)
+ * Constructs a string of HTML <option>s for a given product ID. This
+ * will always include global versions and inherited versions (if the
+ * passed ID is that of a component).
+ *
+ * @param integer Product ID
+ * @param string Selection
+ * @param bool Include obsolete versions?
+ *
+ * @return string Constructed <option> HTML
+ */
+function construct_version_select($productid, $select, $obsolete)
{
- global $bugsys;
-
- $product = $bugsys->datastore['product']["$productid"];
+ $product = bugdar::$datastore['product']["$productid"];
$component = null;
$build = '';
// this is a component
if ($product == null)
{
- $component = $bugsys->datastore['component']["$productid"];
- $product = $bugsys->datastore['product']["$component[parentid]"];
+ $component = bugdar::$datastore['component']["$productid"];
+ $product = bugdar::$datastore['product']["$component[parentid]"];
}
- foreach ($bugsys->datastore['version'] AS $versionid => $version)
+ foreach (bugdar::$datastore['version'] as $versionid => $version)
{
- if ((!$version['productid'] OR $version['productid'] == $component['productid'] OR $version['productid'] == $product['productid']) AND (!$version['obsolete'] OR ($version['obsolete'] AND $obsolete)))
+ if ((!$version['productid'] || $version['productid'] == $component['productid'] || $version['productid'] == $product['productid']) && (!$version['obsolete'] || ($version['obsolete'] && $obsolete)))
{
- $value = intval($product['productid']) . ',' . intval($component['productid']) . ',' . intval($versionid);
- $label = $version['version'];
- $selected = ($value == $select);
- eval('$build .= "' . $bugsys->template->fetch('selectoption') . '";');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'value' => intval($product['productid']) . ',' . intval($component['productid']) . ',' . intval($versionid),
+ 'label' => $version['version']
+ );
+ $tpl->vars['selected'] = ($tpl->vars['value'] == $select);
+ $build .= $tpl->evaluate()->getTemplate();
}
}
return $build;
}
-// ###################################################################
/**
-* Constructs an <optgroup> block from a label and a string of
-* HTML <option> elements.
-*
-* @param string Label for this <optgroup>
-* @param string HTML bits
-*
-* @return string Composed HTML
-*/
-function ConstructOptionGroup($glabel, $optbits)
+ * Constructs an <optgroup> block from a label and a string of
+ * HTML <option> elements.
+ *
+ * @param string Label for this <optgroup>
+ * @param string HTML bits
+ *
+ * @return string Composed HTML
+ */
+function construct_option_group($glabel, $optbits)
{
- global $bugsys;
- eval('$HTML = "' . $bugsys->template->fetch('selectoptgroup') . '";');
- return $HTML;
+ $tpl = new BSTemplate('selectoptgroup');
+ $tpl->vars = array(
+ 'glabel' => $glabel,
+ 'optbits' => $optbits
+ );
+ return $tpl->evaluate()->getTemplate();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
error_reporting(E_ALL & ~E_NOTICE);
// ###################################################################
-// initialize the database
+// load the framework
define('ISSO_MT_START', microtime());
define('ISSO_CHECK_POST_REFERER', 1);
require_once('./includes/version.php');
-require_once('./framework/kernel.php');
-$bugsys = new ISSO();
-
-$bugsys->setAppPath(getcwd());
-$bugsys->setApplication('Bugdar');
-$bugsys->setAppVersion(BUGDAR_VERSION);
-
if (!file_exists('./includes/config.php'))
{
echo 'includes/config.php needs to be present!';
require_once('./includes/config.php');
-$bugsys->setDebug($debug);
-
-// ========================= new framework system ========================
define('ISSO', getcwd() . '/includes/framework/');
require_once ISSO . '/App.php';
BSApp::set_debug($debug);
-// =======================================================================
-define('ISSO_DB_LAYER', 'db_mysql');
-$bugsys->load('db_mysql', 'db', true);
-$db->connect($servername, $username, $password, $database, $usepconnect);
+require_once ISSO . '/Functions.php';
+BSFunctions::set_cookie_timeout(3600);
+
+require_once ISSO . '/Input.php';
+$input = BSApp::$input = new BSInput();
+
+// ###################################################################
+// initialize the database
+
+require_once ISSO . '/DbMySqlI.php';
+$db = BSApp::$db = new BSDBMySQLI();
+
+$db->connect($servername, $username, $password, $database);
if ($utf8)
{
$db->query("SET NAMES utf8");
}
-$bugsys->load('functions', 'funct', true);
-$bugsys->load('xml', 'xml', true);
-
-// change cookie expiration to one hour
-$funct->cookieexp = 3600;
-
define('DEVDEBUG', $debug);
define('TABLE_PREFIX', $tableprefix);
define('COOKIE_PREFIX', $cookieprefix);
// ###################################################################
// init the big three
-$bugsys->options = array();
-$bugsys->userinfo = array();
-$bugsys->datastore = array();
+
+class bugdar
+{
+ public static $options = array();
+ public static $userinfo = array();
+ public static $datastore = array();
+
+ public static $permissions = array();
+ public static $emailOptions = array();
+
+ private function __construct() {}
+}
// ###################################################################
// send nocache
$db->error('Invalid SQL error');
}
-while ($store = $db->fetch_array($datastoretemp))
+foreach ($datastoretemp as $store)
{
- $bugsys->datastore["$store[title]"] = unserialize($store['data']);
+ bugdar::$datastore["$store[title]"] = unserialize($store['data']);
}
-$bugsys->options = $bugsys->datastore['setting'];
-$bugsys->options['columnoptions'] = unserialize($bugsys->options['columnoptions']);
-unset($bugsys->datastore['setting']);
-
-$bugsys->setAppVersion($bugsys->options['trackerversion']);
+bugdar::$options = bugdar::$datastore['setting'];
+bugdar::$options['columnoptions'] = unserialize(bugdar::$options['columnoptions']);
+unset(bugdar::$datastore['setting']);
// ###################################################################
// load permissions
// ###################################################################
// load userinfo
-$authMethod = ((defined('USE_DEFAULT_AUTH_METHOD') AND constant('USE_DEFAULT_AUTH_METHOD') == 1) ? 'default' : $bugsys->options['authmethod']);
+$authMethod = ((defined('USE_DEFAULT_AUTH_METHOD') AND constant('USE_DEFAULT_AUTH_METHOD') == 1) ? 'default' : bugdar::$options['authmethod']);
require_once('./includes/auth/auth_' . $authMethod . '.php');
$authClass = 'Authentication' . str_replace(' ', '', ucwords(str_replace('_', ' ', $authMethod)));
-$bugsys->auth = $auth = new $authClass();
+$auth = new $authClass();
if ($auth->authenticateCookies())
{
- $bugsys->userinfo = $auth->fetchBugdarUser();
- $bugsys->userinfo['permissions'] = FetchUserPermissions($bugsys->userinfo);
- $bugsys->userinfo['displaytitle'] = $bugsys->datastore['usergroup'][ $bugsys->userinfo['usergroupid'] ]['displaytitle'];
- $bugsys->userinfo['columnoptions'] = unserialize($bugsys->userinfo['columnoptions']);
+ bugdar::$userinfo = $auth->fetchBugdarUser();
+ bugdar::$userinfo['permissions'] = FetchUserPermissions(bugdar::$userinfo);
+ bugdar::$userinfo['displaytitle'] = bugdar::$datastore['usergroup'][ bugdar::$userinfo['usergroupid'] ]['displaytitle'];
+ bugdar::$userinfo['columnoptions'] = unserialize(bugdar::$userinfo['columnoptions']);
}
else
{
- $bugsys->userinfo = fetch_guest_user();
+ bugdar::$userinfo = fetch_guest_user();
}
// ###################################################################
$stylevar['right'] = ($language['direction'] == 'ltr' ? 'right' : 'left');
// start gettext engine
-if (!$bugsys->options['devgettext'])
+if (!bugdar::$options['devgettext'])
{
putenv("LANG=$language[langcode]");
putenv("LANGUAGE=$language[langcode]");
}
else
{
- $bugsys->debug("using custom MOReader instead of Gettext");
+ BSApp::debug("using custom MOReader instead of Gettext");
}
// ###################################################################
// initialize the date system
-$bugsys->load('date', 'datef', true);
-$datef->usertz = $bugsys->userinfo['timezone'] + ($bugsys->userinfo['usedst'] * 1);
-$bugsys->debug('user tz = ' . $bugsys->userinfo['timezone'] . '; use version = ' . $datef->usertz);
-$datef->fetch_offset();
+require_once ISSO . '/Date.php';
+$datef = BSApp::$date = new BSDate();
+$datef->setUserTimeZone(bugdar::$userinfo['timezone'] + (bugdar::$userinfo['usedst'] * 1));
+BSApp::debug('user tz = ' . bugdar::$userinfo['timezone'] . '; use version = ' . $datef->usertz);
-// ###################################################################
-// mail system
-$bugsys->load('mail', 'mail', true);
-$mail->setFromAddress($bugsys->options['webmasteremail']);
-$mail->setFromName(T('Bugdar Notification'));
-
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
function textdomain() {}
function bind_textdomain_codeset() {}
- $bugsys->debug('NOTICE: gettext not installed');
+ BSApp::debug('NOTICE: gettext not installed');
}
// ###################################################################
// determines the user's language
function fetch_user_language()
{
- global $bugsys;
-
- if ($bugsys->userinfo['userid'])
+ if (bugdar::$userinfo['userid'])
{
- $languageid = $bugsys->userinfo['languageid'];
- $language = $bugsys->datastore['language']["$languageid"];
+ $languageid = bugdar::$userinfo['languageid'];
+ $language = bugdar::$datastore['language']["$languageid"];
}
- if (!$languageid AND is_array($bugsys->datastore['language']))
+ if (!$languageid AND is_array(bugdar::$datastore['language']))
{
- foreach ($bugsys->datastore['language'] AS $language)
+ foreach (bugdar::$datastore['language'] AS $language)
{
- if ($bugsys->options['defaultlanguage'] == $language['languageid'])
+ if (bugdar::$options['defaultlanguage'] == $language['languageid'])
{
$languageid = $language['languageid'];
- $language = $bugsys->datastore['language']["$languageid"];
+ $language = bugdar::$datastore['language']["$languageid"];
break;
}
}
*/
function T($str)
{
- global $bugsys;
static $mo;
- if (!$bugsys->options['devgettext'])
+ if (!bugdar::$options['devgettext'])
{
return _($str);
}
$info = fetch_user_language();
if ($info['langcode'] == null)
{
- $bugsys->debug("cannot translate '$str'");
+ BSApp::debug("cannot translate '$str'");
return $str;
}
$mo = new MOReader("locale/$info[langcode]/LC_MESSAGES/messages.mo");
return $mo->T($str);
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
--- /dev/null
+<?php
+/*=====================================================================*\
+|| ###################################################################
+|| # Bugdar
+|| # Copyright (c)2005-2008 Blue Static
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version 2 of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+require_once ISSO . '/Pagination.php';
+
+/**
+ * Pagination
+ *
+ * Subclass of BSPagination
+ *
+ * @author rsesek
+ * @copyright Copyright (c)2005 - 2008, Blue Static
+ * @package Bugdar
+ *
+ */
+class Pagination extends BSPagination
+{
+ /**
+ * Sets the variables used by the system
+ */
+ protected function _setVariables()
+ {
+ $this->page = BSApp::$input->inputClean('p', TYPE_UINT);
+ $this->defaultperpage = bugdar::$options['defaultpp'];
+ $this->perpage = BSApp::$input->inputClean('pp', TYPE_UINT);
+ $this->pagelinks = bugdar::$options['pagelinks'];
+ $this->maxperpage = bugdar::$options['maxpp'];
+ }
+
+ /**
+ * Processes an individual page link
+ */
+ protected function _bitProcessor($baselink, $isCurrent, $pagenumber)
+ {
+ $template = new BSTemplate('pagenav_bit');
+ $template->vars = array(
+ 'baselink' => $baselink,
+ 'nolink' => $isCurrent,
+ 'number' => $pagenumber,
+ 'paginator' => $this
+ );
+ return $template->evaluate()->getTemplate();
+ }
+
+ /**
+ * Generates the entire page navigation HTML
+ */
+ protected function _navigationProcessor($baselink, $next, $prev, $show2, $bits)
+ {
+ global $show;
+
+ $show = array_merge($show, $show2);
+
+ $template = new BSTemplate('pagenav');
+ $template->vars = array(
+ 'baselink' => $baselink,
+ 'nextpage' => $next,
+ 'prevpage' => $prev,
+ 'pagebits' => $bits,
+ 'paginator' => $this
+ );
+ return $template->evaluate()->getTemplate();
+ }
+}
+
+?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-$bugsys->permissions = array(
+bugdar::$permissions = array(
'canviewbugs' => 1, // can view bugs
'cansearch' => 2, // can use the search
'cansubscribe' => 4, // can email subscribe
'canviewownhidden' => 33554432 // can view own hidden bugs
);
-$bugsys->emailoptions = array(
+bugdar::$emailOptions = array(
'relations' => array(
// a user's relation to the bug
'-notapplicable-' => 0, // not applicable
)
);
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
define('BUGDAR_VERSION', '1.2.1');
}
-/*=====================================================================*
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'pagenav_bit'
);
-define('SVN', '$Id$');
$focus['index'] = 'focus';
}
$sort = new ListSorter('index');
-LoadPaginationFramework();
+
+require_once 'includes/pagination.php';
+$pagination = new Pagination();
+$pagination->processIncomingData();
// ###################################################################
-$count = $db->query_first("
+$count = $db->queryFirst("
SELECT COUNT(*) AS count
FROM " . TABLE_PREFIX . "bug
- WHERE (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (hidden AND userid = " . $bugsys->userinfo['userid'] . " AND product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ")
- AND product IN (" . fetch_on_bits('canviewbugs') . ")" . (($bugsys->options['hidestatuses'] OR isset($bugsys->userinfo['hidestatuses'])) ? "
- AND status NOT IN (" . ($bugsys->userinfo['hidestatuses'] != '' ? $bugsys->userinfo['hidestatuses'] : $bugsys->options['hidestatuses']) . ")" : "")
+ WHERE (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (hidden AND userid = " . bugdar::$userinfo['userid'] . " AND product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ")
+ AND product IN (" . fetch_on_bits('canviewbugs') . ")" . ((bugdar::$options['hidestatuses'] OR isset(bugdar::$userinfo['hidestatuses'])) ? "
+ AND status NOT IN (" . (bugdar::$userinfo['hidestatuses'] != '' ? bugdar::$userinfo['hidestatuses'] : bugdar::$options['hidestatuses']) . ")" : "")
);
if (!$count['count'])
$pagination->setTotal($count['count']);
$pagination->splitPages();
-$bugs_fetch = $db->query($sort->fetch_sql_query(null, $pagination->fetchLimit($pagination->getPage() - 1) . ", " . $pagination->getPerPage()));
+$bugs_fetch = $db->query($sort->fetchSqlQuery(null, $pagination->fetchLimit($pagination->getPage() - 1) . ", " . $pagination->getPerPage()));
-while ($bug = $db->fetch_array($bugs_fetch))
+foreach ($bugs_fetch as $bug)
{
- $funct->exec_swap_bg('altcolor', '');
- $bug = ProcessBugDataForDisplay($bug, $funct->bgcolour);
+ BSFunctions::swap_css_classes('altcolor', '');
+ $bug = ProcessBugDataForDisplay($bug, BSFunctions::$cssClass);
$bugs .= $sort->constructRow($bug);
}
-$db->free_result($bugs_fetch);
+$bugs_fetch->free();
$columnHeads = $sort->constructColumnHeaders(true, 'p=' . $pagination->page . '&pp=' . $pagination->perpage);
$show['pagenav'] = ($pagination->getPageCount() > 1);
-$pagenav = $pagination->constructPageNav($sort->fetch_sort_link($sort->sortkey));
-eval('$template->flush("' . $template->fetch('trackerhome') . '");');
+$tpl = new BSTemplate('trackerhome');
+$tpl->vars = array(
+ 'columnHeads' => $columnHeads,
+ 'bugs' => $bugs,
+ 'pagenav' => $pagination->constructPageNav($sort->fetchSortLink($sort->sortkey))
+);
+$tpl->evaluate()->flush();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-define('SVN', '$Id$');
chdir('../admin/');
require_once('./global.php');
// you can change what you want to conver to here
define('TARGET', 'utf8_general_ci');
-$bugsys->input_clean('step', TYPE_UINT);
+$input->inputClean('step', TYPE_UINT);
// columns to convert per table
$columnConversions = array();
// ###################################################################
-if ($bugsys->in['step'] == 0)
+if ($input->in['step'] == 0)
{
- $collation = $db->query_first("SHOW VARIABLES LIKE 'collation_database'");
+ $collation = $db->queryFirst("SHOW VARIABLES LIKE 'collation_database'");
echo '<h1>Convert Database Character Set</h1>';
echo '<p>Earlier versions of Bugdar did not check or enforce the MySQL database character set or collation. It is recommended that the database be set at <strong>' . TARGET . '</strong>. This script can migrate all of data from your current character set/collation of <strong>' . $collation['Value'] . '</strong>. If you would like to convert your database to utf8, please click the link below.</p>';
// ###################################################################
-else if ($bugsys->in['step'] == 1)
+else if ($input->in['step'] == 1)
{
echo '<h1>Preserve Existing Data</h1>';
echo '<p>This converts all the table columns that are stored with a character set to a BLOB type to ensure there are no problems with the target character set.</p>';
while ($table = $db->fetch_array($tables, false))
{
$columns = $db->query("SHOW FULL COLUMNS FROM $table[0]");
- while ($col = $db->fetch_array($columns))
+ foreach ($columns as $col)
{
if (!is_null($col['Collation']) AND (strpos($col['Type'], 'char') !== false OR strpos($col['Type'], 'text') !== false))
{
// ###################################################################
-else if ($bugsys->in['step'] == 2)
+else if ($input->in['step'] == 2)
{
echo '<h1>Conversion Complete</h1>';
echo '<p>Your database has now been converted to the <strong>' . TARGET . '</strong> collation. Congratulations. Please check that everything is operating correctly.</p>';
$admin->page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
)
);
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
// init the big three
-$bugsys->options = array();
-$bugsys->userinfo = array();
-$bugsys->datastore = array();
+bugdar::$options = array();
+bugdar::$userinfo = array();
+bugdar::$datastore = array();
// ###################################################################
$bugsys->load('installer', null);
-$bugsys->input_clean('mark', TYPE_UINT);
+$input->inputClean('mark', TYPE_UINT);
-if ($bugsys->in['mark'] == STOP_MARK)
+if ($input->in['mark'] == STOP_MARK)
{
if (!preg_match('#^upgrade([0-9]*)\.php$#i', ACTIVE_SITE, $matches))
{
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Installation Check</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 2)
+if ($input->in['mark'] == 2)
{
?>
<h1>Initializing Database</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 3)
+if ($input->in['mark'] == 3)
{
?>
<h1>Loading Default Data</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 4)
+if ($input->in['mark'] == 4)
{
?>
<h1>Loading Settings</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 5)
+if ($input->in['mark'] == 5)
{
?>
<h1>Cache Data</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 6)
+if ($input->in['mark'] == 6)
{
$value = 'http' . ($_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '') . str_replace('/install/install.php', '', $_SERVER['SCRIPT_NAME']);
?>
// ###################################################################
-if ($bugsys->in['mark'] == 7)
+if ($input->in['mark'] == 7)
{
?>
<h1>New Administrator</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 8)
+if ($input->in['mark'] == 8)
{
?>
<h1>User Added</h1>
// the installer, so we need to do it manually
build_usergroups();
- $user = new UserAPI($bugsys);
- $user->set('email', $bugsys->in['email']);
- $user->set('displayname', $bugsys->in['displayname']);
- $user->set('password', $bugsys->in['password']);
+ $user = new UserAPI();
+ $user->set('email', $input->in['email']);
+ $user->set('displayname', $input->in['displayname']);
+ $user->set('password', $input->in['password']);
$user->set('showcolors', 1);
$user->set('usergroupid', 6, true, false); // don't verify because we haven't cached usergroups yet
$user->insert();
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
PRIMARY KEY (bugid)
);";
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'redirectheaders' => '0',
);
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if (!isset($bugsys->in['next']))
+if (!isset($input->in['next']))
{
$db->showerrors = false;
- $version = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "setting WHERE varname = 'trackerversion'");
+ $version = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "setting WHERE varname = 'trackerversion'");
$version = $version['value'];
if ($version == '[#]version[#]')
else
{
- if ($bugsys->versions[ $bugsys->in['next'] ] == -1)
+ if ($bugsys->versions[ $input->in['next'] ] == -1)
{
die('Bugdar is up-to-date already');
}
- header("Location: upgrade" . $bugsys->versions[ $bugsys->in['next'] ] . ".php");
+ header("Location: upgrade" . $bugsys->versions[ $input->in['next'] ] . ".php");
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Minor Database Table Changes</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 2)
+if ($input->in['mark'] == 2)
{
?>
<h1>Search Table Changes</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 3)
+if ($input->in['mark'] == 3)
{
?>
<h1>Custom Field Updates</h1>
<?php
// gets all the fields
$fields = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield");
- while ($field = $db->fetch_array($fields))
+ foreach ($fields as $field)
{
// create the database field
$db->query("ALTER TABLE " . TABLE_PREFIX . "bug ADD custom$field[fieldid] MEDIUMTEXT NULL");
// update all the data
$data = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugvaluefill");
- while ($custom = $db->fetch_array($data))
+ foreach ($data as $custom)
{
echo ".";
$db->query("UPDATE " . TABLE_PREFIX . "bug SET custom$field[fieldid] = '" . $db->escape_string($custom["field$field[fieldid]"]) . "' WHERE bugid = $custom[bugid]");
// ###################################################################
-if ($bugsys->in['mark'] == 4)
+if ($input->in['mark'] == 4)
{
?>
<h1>Database Table Changes</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 5)
+if ($input->in['mark'] == 5)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Schema Updates</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 2)
+if ($input->in['mark'] == 2)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Potential Schema Updates</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 2)
+if ($input->in['mark'] == 2)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Major Table Changes</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 2)
+if ($input->in['mark'] == 2)
{
?>
<h1>User Table Changes</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 3)
+if ($input->in['mark'] == 3)
{
?>
<h1>Minor Table Changes</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 4)
+if ($input->in['mark'] == 4)
{
?>
<h1>Caching User Data in Bug Table</h1>
$userlist = array();
$users = $db->query("SELECT userid, displayname FROM " . TABLE_PREFIX . "user");
- while ($user = $db->fetch_array($users))
+ foreach ($users as $user)
{
$userlist["$user[userid]"] = $user['displayname'];
}
$bugs = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug");
- while ($bug = $db->fetch_array($bugs))
+ foreach ($bugs as $bug)
{
$db->query("
UPDATE " . TABLE_PREFIX . "bug
// ###################################################################
-if ($bugsys->in['mark'] == 5)
+if ($input->in['mark'] == 5)
{
?>
<h1>Updating Old History Items</h1>
echo "Updating historical records";
$history = $db->query("SELECT * FROM " . TABLE_PREFIX . "history");
- while ($log = $db->fetch_array($history))
+ foreach ($history as $log)
{
$matches = array();
if (preg_match('#custom_field([0-9]+?)#i', $log['field'], $matches))
// ###################################################################
-if ($bugsys->in['mark'] == 6)
+if ($input->in['mark'] == 6)
{
?>
<h1>Adding User Email Options</h1>
echo "Setting email options";
$users = $db->query("SELECT userid FROM " . TABLE_PREFIX . "user");
- while ($user = $db->fetch_array($users))
+ foreach ($users as $user)
{
$db->query("
INSERT INTO " . TABLE_PREFIX . "useremail
// ###################################################################
-if ($bugsys->in['mark'] == 7)
+if ($input->in['mark'] == 7)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Language System Updates</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 2)
+if ($input->in['mark'] == 2)
{
?>
<h1>English US Changes</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 3)
+if ($input->in['mark'] == 3)
{
?>
<h1>Adding New Permission Mask</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 4)
+if ($input->in['mark'] == 4)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Rename Automatic Actions</h1>
build_automations();
echo "Rebuilding the automations cahce<br />\n";
- $topic = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = 'newreply'");
+ $topic = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = 'newreply'");
if (md5($topic['body']) == '7e1154340454ca6d8f8ba47aab057c23')
{
$topic = $db->query("UPDATE " . TABLE_PREFIX . "fieldhelp SET body = 'Here you can specify additional comments. If you do not change any fields, this will merely attach a comment.
// ###################################################################
-if ($bugsys->in['mark'] == 2)
+if ($input->in['mark'] == 2)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
// ###################################################################
-if ($bugsys->in['mark'] == 0)
+if ($input->in['mark'] == 0)
{
?>
<h1>Welcome to Bugdar</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 1)
+if ($input->in['mark'] == 1)
{
?>
<h1>Schema Changes</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 2)
+if ($input->in['mark'] == 2)
{
?>
<h1>Version Number Change</h1>
page_end();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
<email>
- <subject>Account Approved at {$bugsys->options['trackertitle']}</subject>
+ <subject>Account Approved at {bugdar::$options['trackertitle']}</subject>
<bodyText>Hi $user[displayname],
-Your account was awaiting moderation at {$bugsys->options['trackertitle']}. Today, an administrator approved your registration and you are now able to use the bug tracker fully.
+Your account was awaiting moderation at {bugdar::$options['trackertitle']}. Today, an administrator approved your registration and you are now able to use the bug tracker fully.
If you have any questions, please don't hesitate to contact the webmaster.</bodyText>
</email>
\ No newline at end of file
<email>
- <subject>Welcome to {$bugsys->options['trackertitle']}</subject>
- <bodyText>Hi {$bugsys->in['displayname']},
+ <subject>Welcome to {bugdar::$options['trackertitle']}</subject>
+ <bodyText>Hi {$input->in['displayname']},
-Welcome to the {$bugsys->options['trackertitle']} tracker. Before you can begin posting bug reports, you'll need to activate your account. To do this, please click this link:
+Welcome to the {bugdar::$options['trackertitle']} tracker. Before you can begin posting bug reports, you'll need to activate your account. To do this, please click this link:
-{$bugsys->options['trackerurl']}/register.php?do=activate&userid=$userid&activator=$activationid</bodyText>
+{bugdar::$options['trackerurl']}/register.php?do=activate&userid=$userid&activator=$activationid</bodyText>
</email>
\ No newline at end of file
<email>
- <subject>{$this->registry->options['trackertitle']} Bug Notification - {$this->bug['summary']}</subject>
+ <subject>{bugdar::$options['trackertitle']} Bug Notification - {$this->bug['summary']}</subject>
<bodyText>Hi {$this->users[$userid]['displayname']},
-You are receiving this email because you have opted to get notifications for the {$this->registry->options['trackertitle']} bug tracker.
+You are receiving this email because you have opted to get notifications for the {bugdar::$options['trackertitle']} bug tracker.
-The bug is "{$this->bug['summary']}" (id: {$this->bug['bugid']}) located at {$this->registry->options['trackerurl']}/showreport.php?bugid={$this->bug['bugid']}
+The bug is "{$this->bug['summary']}" (id: {$this->bug['bugid']}) located at {bugdar::$options['trackerurl']}/showreport.php?bugid={$this->bug['bugid']}
Here are the notices:
###################################################################
###################################################################
If you no longer want to receive email from us, please log into your account and click the "My Controls" tab at the top of the screen to change email preferences.
-{$this->registry->options['trackerurl']}</bodyText>
+{bugdar::$options['trackerurl']}</bodyText>
</email>
\ No newline at end of file
Description: $attachment[description]
File size: $attachment[filesize] Bytes
Makes obsolete: $obsoletes
-View: {$this->registry->options['trackerurl']}/viewattachment.php?attachmentid=$id
+View: {bugdar::$options['trackerurl']}/viewattachment.php?attachmentid=$id
============================================
\ No newline at end of file
-The priority has been elevatd from "{$this->registry->datastore['priority'][$old]['priority']}" to "{$this->registry->datastore['priority'][$new]['priority']}".
\ No newline at end of file
+The priority has been elevatd from "{bugdar::$datastore['priority'][$old]['priority']}" to "{bugdar::$datastore['priority'][$new]['priority']}".
\ No newline at end of file
-This bug has been resolved with resolution "{$this->registry->datastore['resolution'][$new]['resolution']}", from "{$this->registry->datastore['resolution'][$old]['resolution']}".
\ No newline at end of file
+This bug has been resolved with resolution "{bugdar::$datastore['resolution'][$new]['resolution']}", from "{bugdar::$datastore['resolution'][$old]['resolution']}".
\ No newline at end of file
-The severity has been elevated from "{$this->registry->datastore['severity'][$old]['severity']}" to "{$this->registry->datastore['severity'][$new]['severity']}".
\ No newline at end of file
+The severity has been elevated from "{bugdar::$datastore['severity'][$old]['severity']}" to "{bugdar::$datastore['severity'][$new]['severity']}".
\ No newline at end of file
-The status of the bug is now "{$this->registry->datastore['status'][$new]['status']}", from "{$this->registry->datastore['status'][$old]['status']}".
\ No newline at end of file
+The status of the bug is now "{bugdar::$datastore['status'][$new]['status']}", from "{bugdar::$datastore['status'][$old]['status']}".
\ No newline at end of file
<email>
- <subject>{$bugsys->options['trackertitle']} Password Reset</subject>
- <bodyText>Hi {$user->objdata['displayname']},
+ <subject><%- bugdar::$options['trackertitle'] %> Password Reset</subject>
+ <bodyText>Hi {$user->record['displayname']},
-You requested this lost password email at the {$bugsys->options['trackertitle']} bug tracker. To reset your password, simply click the link below (or paste it into your browser window exactly) and enter a new password.
+You requested this lost password email at the <%- bugdar::$options['trackertitle'] %> bug tracker. To reset your password, simply click the link below (or paste it into your browser window exactly) and enter a new password.
-{$bugsys->options['trackerurl']}/login.php?do=recoverpw&activator=$activator
+<%- bugdar::$options['trackerurl'] %>/login.php?do=recoverpw&activator=<%- $activator %>
If you did not request this, do not worry as this notice will expire in 24 hours.</bodyText>
</email>
\ No newline at end of file
<email>
- <subject>Welcome to {$bugsys->options['trackertitle']}</subject>
+ <subject>Welcome to {bugdar::$options['trackertitle']}</subject>
<bodyText>Hi {$displayName},
-Thank you for taking the time to register at {$bugsys->options['trackertitle']}. We look forward to your contributations to making our products better.
+Thank you for taking the time to register at {bugdar::$options['trackertitle']}. We look forward to your contributations to making our products better.
If you have any questions, please don't hesitate to contact the webmaster.</bodyText>
</email>
\ No newline at end of file
'passwordreset'
);
-define('SVN', '$Id$');
$focus['user'] = 'focus';
require_once('./global.php');
require_once('./includes/api_user.php');
-require_once('./includes/class_api_error.php');
-
-APIError(array(new API_Error_Handler($message), 'user_cumulative'));
// ###################################################################
-if ($bugsys->userinfo['userid'] AND $_REQUEST['do'] != 'logout' AND $_POST['do'] != 'cplogin' AND $_REQUEST['do'] != 'cplogout')
+if (bugdar::$userinfo['userid'] AND $_REQUEST['do'] != 'logout' AND $_POST['do'] != 'cplogin' AND $_REQUEST['do'] != 'cplogout')
{
$message->error(T('You are already logged in.'));
}
if (empty($_REQUEST['do']))
{
- eval('$template->flush("' . $template->fetch('login') . '");');
+ BSTemplate::fetch('login')->evaluate()->flush();
}
// ###################################################################
if ($_POST['do'] == 'login' OR $_POST['do'] == 'cplogin')
{
- $keeplogin = $bugsys->input_clean('rememberme', TYPE_BOOL);
+ $keeplogin = $input->inputClean('rememberme', TYPE_BOOL);
if ($_POST['cplogin'])
{
$keeplogin = 0;
$url = 'index.php';
}
- if ($auth->authenticateLogin($bugsys->in['email'], $bugsys->in['password'], $keeplogin))
+ if ($auth->authenticateLogin($input->in['email'], $input->in['password'], $keeplogin))
{
if ($_POST['do'] == 'cplogin')
{
- $hash = $funct->rand(90);
+ $hash = BSFunctions::random(90);
$db->query("DELETE FROM " . TABLE_PREFIX . "adminsession WHERE dateline < " . (TIMENOW - 3600));
$db->query("INSERT INTO " . TABLE_PREFIX . "adminsession (sessionid, userid, dateline) VALUES ('$hash', " . $auth->bugdarUser['userid'] . ", " . TIMENOW . ")");
- $funct->cookie(COOKIE_PREFIX . 'adminsession', $hash, false);
+ BSFunctions::cookie(COOKIE_PREFIX . 'adminsession', $hash, false);
}
$message->redirect(T('Welcome back! You are now logged in.'), $url);
}
if ($_REQUEST['do'] == 'logout')
{
- if ($bugsys->userinfo['userid'])
+ if (bugdar::$userinfo['userid'])
{
- $db->query("DELETE FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'");
+ $db->query("DELETE FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $input->inputEscape(COOKIE_PREFIX . 'adminsession') . "'");
$auth->clearCookies();
- $funct->cookie(COOKIE_PREFIX . 'adminsession');
+ BSFunctions::cookie(COOKIE_PREFIX . 'adminsession', false);
$message->redirect(T('You have been logged out.'), ($_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : 'index.php'));
}
else
if ($_POST['do'] == 'sendpw')
{
- $user = new UserAPI($bugsys);
- $user->set('email', $bugsys->in['email'], true, false); // don't verify so we don't get errors about existing emails
- $user->set_condition(array('email'));
+ $user = new UserAPI();
+ $user->set('email', $input->in['email'], true, false); // don't verify so we don't get errors about existing emails
+ $user->setCondition(array('email'));
$user->fetch();
if ($message->hasErrors())
}
else
{
- $activator = $funct->rand(25);
- $db->query("INSERT INTO " . TABLE_PREFIX . "passwordreset (activatorid, dateline, userid) VALUES ('" . $activator . "', " . TIMENOW . ", " . $user->objdata['userid'] . ")");
-
- eval('$email = "' . $template->fetch(FetchEmailPath('passwordreset.xml', $bugsys->datastore['language'][$user->objdata['languageid']]['langcode'])) . '";');
- $email = $bugsys->xml->parse($email);
+ $activator = BSFunctions::random(25);
+ $db->query("INSERT INTO " . TABLE_PREFIX . "passwordreset (activatorid, dateline, userid) VALUES ('" . $activator . "', " . TIMENOW . ", " . $user->record['userid'] . ")");
- $mail->setSubject($email['email']['subject']['value']);
- $mail->setBodyText($email['email']['bodyText']['value']);
+ $email = get_email_text('password_reset');
+ $mail = new BSMail();
+ $mail->setSubject($email['subject']);
+ $mail->setBodyText(sprintf($email['bodyText'], $user->record['displayname'], bugdar::$options['trackertitle'], bugdar::$options['trackerurl'], $activator));
+ $mail->setFromAddress(MAIL_FROM_ADDRESS);
+ $mail->setFromName(MAIL_FROM_NAME);
+ $mail->send($user->record['email'], $user->record['displayname']);
- $mail->send($user->objdata['email'], $user->objdata['displayname']);
-
- $message->message(sprintf(T('An email has been dispatched to %1$s that contains instructions on how to reset your password.'), $user->objdata['email']));
+ $message->message(sprintf(T('An email has been dispatched to %1$s that contains instructions on how to reset your password.'), $user->record['email']));
}
}
if ($_REQUEST['do'] == 'lostpw')
{
- eval('$template->flush("' . $template->fetch('lostpassword') . '");');
+ BSTemplate::fetch('lostpassword')->evaluate()->flush();
}
// ###################################################################
$db->query("DELETE FROM " . TABLE_PREFIX . "passwordreset WHERE dateline < " . (TIMENOW - 86400));
// now look for ours
- $activation = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "passwordreset WHERE activatorid = '" . $bugsys->input_escape('activator') . "'");
+ $activation = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "passwordreset WHERE activatorid = '" . $input->inputEscape('activator') . "'");
if (!$activation)
{
$message->error(L_INVALID_ID);
}
- $user = new UserAPI($bugsys);
+ $user = new UserAPI();
$user->set('userid', $activation['userid']);
- $user->set_condition();
- if ($bugsys->in['fix_password'] != $bugsys->in['confirm_password'])
+ if ($input->in['fix_password'] != $input->in['confirm_password'])
{
$message->addError(T('The passwords you entered do not patch.'));
}
- if (empty($bugsys->in['fix_password']))
+ if (empty($input->in['fix_password']))
{
$message->addError(T('Your new password cannot be empty.'));
}
- $user->set('password', $bugsys->in['fix_password']);
+ $user->set('password', $input->in['fix_password']);
if (!$message->hasErrors())
{
$db->query("DELETE FROM " . TABLE_PREFIX . "passwordreset WHERE dateline < " . (TIMENOW - 86400));
// now look for ours
- $activation = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "passwordreset WHERE activatorid = '" . $bugsys->input_escape('activator') . "'");
+ $activation = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "passwordreset WHERE activatorid = '" . $input->inputEscape('activator') . "'");
if (!$activation)
{
$message->error(T('Invalid activation reset key. Please make sure you copied the URL exactly as it appeared in the email.'));
}
- eval('$template->flush("' . $template->fetch('passwordreset') . '");');
+ $tpl = new BSTemplate('passwordreset');
+ $tpl->vars = array(
+ 'activation' => $activation,
+ 'message' => $message
+ );
+ $tpl->evaluate()->flush();
}
// ###################################################################
{
if ($_COOKIE[COOKIE_PREFIX . 'adminsession'])
{
- $db->query("DELETE FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'");
- $funct->cookie(COOKIE_PREFIX . 'adminsession');
+ $db->query("DELETE FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $input->inputEscape(COOKIE_PREFIX . 'adminsession') . "'");
+ BSFunctions::cookie(COOKIE_PREFIX . 'adminsession', false);
$message->redirect(T('You have been logged out.'), 'admin/');
}
else
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'newreport',
);
-define('SVN', '$Id$');
$focus['newreport'] = 'focus';
require_once('./includes/api_bug.php');
require_once('./includes/api_comment.php');
-require_once('./includes/class_api_error.php');
-APIError(array(new API_Error_Handler($message), 'user_cumulative'));
-$product = explode(',', $bugsys->in['product']);
+$product = explode(',', $input->in['product']);
if (!can_perform('cansubmitbugs', $product[0]))
{
$message->errorPermission();
if ($_POST['do'] == 'insert')
{
- $bug = new BugAPI($bugsys);
- $comment = new CommentAPI($bugsys);
+ $bug = new BugAPI();
+ $comment = new CommentAPI();
$notif = new NotificationCenter();
- $bug->set('userid', $bugsys->userinfo['userid']);
- $bug->set('username', $bugsys->userinfo['displayname']);
- $bug->set('summary', $bugsys->in['summary']);
- $bug->set('severity', $bugsys->in['severity']);
+ $bug->set('userid', bugdar::$userinfo['userid']);
+ $bug->set('username', bugdar::$userinfo['displayname']);
+ $bug->set('summary', $input->in['summary']);
+ $bug->set('severity', $input->in['severity']);
- $comment->set('userid', $bugsys->userinfo['userid']);
- $comment->set('comment', $bugsys->in['comment']);
- $comment->set('parselinks', $bugsys->in['parselinks']);
+ $comment->set('userid', bugdar::$userinfo['userid']);
+ $comment->set('comment', $input->in['comment']);
+ $comment->set('parselinks', $input->in['parselinks']);
// -------------------------------------------------------------------
// check permissions on various input values
- if (!can_perform('canchangestatus', $bugsys->in['product']))
+ if (!can_perform('canchangestatus', $input->in['product']))
{
- $bug->set('priority', $bugsys->options['defaultpriority']);
- $bug->set('status', $bugsys->options['defaultstatus']);
- $bug->set('resolution', $bugsys->options['defaultresolve']);
+ $bug->set('priority', bugdar::$options['defaultpriority']);
+ $bug->set('status', bugdar::$options['defaultstatus']);
+ $bug->set('resolution', bugdar::$options['defaultresolve']);
}
else
{
- $bug->set('priority', $bugsys->in['priority']);
- $bug->set('status', $bugsys->in['status']);
- $bug->set('resolution', $bugsys->in['resolution']);
+ $bug->set('priority', $input->in['priority']);
+ $bug->set('status', $input->in['status']);
+ $bug->set('resolution', $input->in['resolution']);
}
- if (!can_perform('canassign', $bugsys->in['product']))
+ if (!can_perform('canassign', $input->in['product']))
{
- $bug->set('assignedto', $bugsys->options['defaultassign']);
+ $bug->set('assignedto', bugdar::$options['defaultassign']);
}
else
{
// assigned person is not a dev or a valid user
- $bug->set('assignedto', $bugsys->in['assignedto']);
+ $bug->set('assignedto', $input->in['assignedto']);
}
- $product = explode(',', $bugsys->in['product']);
+ $product = explode(',', $input->in['product']);
$bug->set('product', $product[0]);
$bug->set('component', $product[1]);
$bug->set('version', $product[2]);
$comment->set('bugid', $bug->insertid);
$comment->insert();
- $notif->send_new_bug_notice($bug->values, $comment->values);
+ $notif->sendNewBugNotice($bug->values, $comment->values);
- $bug = new BugAPI($bugsys); // need to destroy because update will think the insert fields need to be changed, too
- $bug->dorelations = array();
+ $bug = new BugAPI(); // need to destroy because update will think the insert fields need to be changed, too
$bug->set('bugid', $comment->values['bugid']);
- $bug->set_condition();
$bug->fetch();
$bug->set('dateline', $comment->values['dateline']);
$bug->set('initialreport', $comment->insertid);
$bug->set('lastposttime', $comment->values['dateline']);
- $bug->set('lastpostby', $bugsys->userinfo['userid']);
- $bug->set('lastpostbyname', $bugsys->userinfo['displayname']);
+ $bug->set('lastpostby', bugdar::$userinfo['userid']);
+ $bug->set('lastpostbyname', bugdar::$userinfo['displayname']);
$bug->set('hiddenlastposttime', $comment->values['dateline']);
- $bug->set('hiddenlastpostby', $bugsys->userinfo['userid']);
- $bug->set('hiddenlastpostbyname', $bugsys->userinfo['displayname']);
+ $bug->set('hiddenlastpostby', bugdar::$userinfo['userid']);
+ $bug->set('hiddenlastpostbyname', bugdar::$userinfo['displayname']);
$bug->update();
- $notif->set_bug_data($bug->objdata);
+ $notif->setBugData($bug->record);
$notif->finalize();
- $message->redirect(T('The bug has been added to the database.'), ($bugsys->in['submit_reload'] == '' ? "showreport.php?bugid=" . $bug->values['bugid'] : 'newreport.php'));
+ $message->redirect(T('The bug has been added to the database.'), ($input->in['submit_reload'] == '' ? "showreport.php?bugid=" . $bug->values['bugid'] : 'newreport.php'));
}
else
{
if ($_REQUEST['do'] == 'add')
{
- if (!is_array($bugsys->datastore['product']))
+ if (!is_array(bugdar::$datastore['product']))
{
$message->error(T('No products have been setup, therefore no bugs can be added.'));
}
- if (!is_array($bugsys->datastore['version']))
+ if (!is_array(bugdar::$datastore['version']))
{
$message->error(T('No versions have been setup underneath your product(s), therefore no bugs can be added.'));
}
- $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', ($bugsys->in['severity'] ? $bugsys->in['severity'] : $bugsys->options['defaultseverity']));
+ $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', ($input->in['severity'] ? $input->in['severity'] : bugdar::$options['defaultseverity']));
$show['changestatus'] = can_perform('canchangestatus');
if (can_perform('canchangestatus'))
{
- $select['priority'] = construct_datastore_select('priority', 'priority', 'priorityid', ($bugsys->in['priority'] ? $bugsys->in['priority'] : $bugsys->options['defaultpriority']));
- $select['status'] = construct_datastore_select('status', 'status', 'statusid', ($bugsys->in['status'] ? $bugsys->in['status'] : $bugsys->options['defaultstatus']));
- $select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid', ($bugsys->in['resolution'] ? $bugsys->in['resolution'] : $bugsys->options['defaultresolve']));
+ $select['priority'] = construct_datastore_select('priority', 'priority', 'priorityid', ($input->in['priority'] ? $input->in['priority'] : bugdar::$options['defaultpriority']));
+ $select['status'] = construct_datastore_select('status', 'status', 'statusid', ($input->in['status'] ? $input->in['status'] : bugdar::$options['defaultstatus']));
+ $select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid', ($input->in['resolution'] ? $input->in['resolution'] : bugdar::$options['defaultresolve']));
}
$show['assign'] = can_perform('canassign');
if (can_perform('canassign'))
{
- foreach ($bugsys->datastore['assignto'] AS $dev)
+ foreach (bugdar::$datastore['assignto'] as $dev)
{
- $value = $dev['userid'];
- $label = construct_user_display($dev, false);
- $selected = ($bugsys->in['assignedto'] ? ($bugsys->in['assignedto'] == $dev['userid']) : ($dev['userid'] == $bugsys->options['defaultassign']));
- eval('$select[dev] .= "' . $template->fetch('selectoption') . '";');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'value' => $dev['userid'],
+ 'label' => construct_user_display($dev, false),
+ 'selected' => ($input->in['assignedto'] ? ($input->in['assignedto'] == $dev['userid']) : ($dev['userid'] == bugdar::$options['defaultassign']))
+ );
+ $select['dev'] = $tpl->evaluate()->getTemplate();
}
}
// custom fields
- $fields = construct_custom_fields($bugsys->in, true);
+ $fields = construct_custom_fields($input->in, true);
$i = 0;
foreach ($fields AS $field)
{
$i++;
}
- $productSelect = ConstructProductSelect('cansubmitbugs', $bugsys->in['product'], false);
-
- $reporter = construct_user_display($bugsys->userinfo);
-
- eval('$template->flush("' . $template->fetch('newreport') . '");');
+ $tpl = new BSTemplate('newreport');
+ $tpl->vars = array(
+ 'reporter' => construct_user_display(bugdar::$userinfo),
+ 'productSelect' => construct_product_select('cansubmitbugs', $input->in['product'], false),
+ 'select' => $select,
+ 'customfields' => $customfields
+ );
+ $tpl->evaluate()->flush();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'register'
);
-define('SVN', '$Id$');
$focus['user'] = 'focus';
require_once('./global.php');
require_once('./includes/api_user.php');
-require_once('./includes/class_api_error.php');
-APIError(array(new API_Error_Handler($message), 'user_cumulative'));
-
// ###################################################################
if ($_POST['do'] == 'insert')
{
- if ($bugsys->userinfo['userid'])
+ if (bugdar::$userinfo['userid'])
{
$message->error(T('Sorry, you are already registered.'));
}
- if (!$bugsys->options['allownewreg'])
+ if (!bugdar::$options['allownewreg'])
{
$message->error(T('Sorry, we don\'t allow new registrations.'));
}
- if ($bugsys->in['email'] != $bugsys->in['confirmemail'])
+ if ($input->in['email'] != $input->in['confirmemail'])
{
$message->addError(T('The emails you entered do not match.'));
}
- if ($bugsys->in['password'] != $bugsys->in['confirmpassword'])
+ if ($input->in['password'] != $input->in['confirmpassword'])
{
$message->addError(T('The passwords you entered did not match.'));
}
- if ($bugsys->options['verifyemail'])
+ if (bugdar::$options['verifyemail'])
{
$usergroupid = 3;
}
else
{
- if ($bugsys->options['moderatenewusers'])
+ if (bugdar::$options['moderatenewusers'])
{
$usergroupid = 4;
}
}
}
- $user = new UserAPI($bugsys);
- $user->set('email', $bugsys->in['email']);
- $user->set('displayname', $bugsys->in['displayname']);
- $user->set('password', $bugsys->in['password']);
- $user->set('showemail', $bugsys->in['showemail']);
+ $user = new UserAPI();
+ $user->set('email', $input->in['email']);
+ $user->set('displayname', $input->in['displayname']);
+ $user->set('password', $input->in['password']);
+ $user->set('showemail', $input->in['showemail']);
$user->set('showcolors', 1);
- $user->set('languageid', $bugsys->in['languageid']);
- $user->set('timezone', $bugsys->options['defaulttimezone']);
+ $user->set('languageid', $input->in['languageid']);
+ $user->set('timezone', bugdar::$options['defaulttimezone']);
$user->set('usergroupid', $usergroupid);
if (!$message->hasErrors())
// Verify email address
if ($usergroupid == 3)
{
- $activationid = $funct->rand(25);
+ $activationid = BSFunctions::random(25);
$db->query("INSERT INTO " . TABLE_PREFIX . "useractivation (userid, activator, dateline, usergroupid) VALUES ($userid, '$activationid', " . TIMENOW . ", 2)");
- eval('$email = "' . $template->fetch(FetchEmailPath('activateaccount.xml', $bugsys->datastore['language'][$bugsys->in['languageid']]['langcode'])) . '";');
- $email = $bugsys->xml->parse($email);
- $mail->setSubject($email['email']['subject']['value']);
- $mail->setBodyText($email['email']['bodyText']['value']);
-
- $mail->send($bugsys->in['email'], $bugsys->in['displayname']);
+ $email = get_email_text('activate_account');
+ $mail = new BSMail();
+ $mail->setSubject($email['subject']);
+ $mail->setBodyText(sprintf($email['bodyText'], $input->in['displayname'], bugdar::$options['trackertitle'], bugdar::$options['trackerurl'], $userid, $activationid));
+ $mail->setFromAddress(MAIL_FROM_ADDRESS);
+ $mail->setFromName(MAIL_FROM_NAME);
+ $mail->send($input->in['email'], $input->in['displayname']);
$message->message(T('You now need to activate your account via email.'));
}
else if ($usergroupid == 4 OR $usergroupid == 2)
{
- if ($bugsys->options['sendwelcomemail'])
+ if (bugdar::$options['sendwelcomemail'])
{
- $displayName = $bugsys->in['displayname'];
- eval('$email = "' . $template->fetch(FetchEmailPath('welcome.xml', $bugsys->datastore['language'][$bugsys->in['languageid']]['langcode'])) . '";');
- $email = $bugsys->xml->parse($email);
- $mail->setSubject($email['email']['subject']['value']);
- $mail->setBodyText($email['email']['bodyText']['value']);
- $mail->send($bugsys->in['email'], $bugsys->in['displayname']);
+ $displayName = $input->in['displayname'];
+
+ $email = get_email_text('welcome');
+ $mail = new BSMail();
+ $mail->setSubject($email['subject']);
+ $mail->setBodyText(sprintf($email['bodyText'], $input->in['displayname'], bugdar::$options['trackertitle']));
+ $mail->setFromAddress(MAIL_FROM_ADDRESS);
+ $mail->setFromName(MAIL_FROM_NAME);
+ $mail->send($input->in['email'], $input->in['displayname']);
}
if ($usergroupid == 4)
if (empty($_REQUEST['do']))
{
- if ($bugsys->userinfo['userid'])
+ if (bugdar::$userinfo['userid'])
{
$message->error(T('Sorry, you are already registered.'));
}
- if (!$bugsys->options['allownewreg'])
+ if (!bugdar::$options['allownewreg'])
{
$message->error(T('Sorry, we don\'t allow new registrations.'));
}
- foreach ($bugsys->datastore['language'] AS $value => $temp)
+ foreach (bugdar::$datastore['language'] as $value => $temp)
{
- $label = $temp['title'];
- $selected = ($value == $bugsys->in['languageid']);
- eval('$opts .= "' . $template->fetch('selectoption') . '";');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'value' => $value,
+ 'label' => $temp['title'],
+ 'selected' => ($value == $input->in['languageid'])
+ );
+ $opts .= $tpl->evaluate()->getTemplate();
}
- eval('$template->flush("' . $template->fetch('register') . '");');
+ $tpl = new BSTemplate('register');
+ $tpl->vars = array(
+ 'opts' => $opts
+ );
+ $tpl->evaluate()->flush();
}
// ###################################################################
if ($_REQUEST['do'] == 'activate')
{
- $bugsys->input_clean('userid', TYPE_UINT);
- if ($useractivation = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $bugsys->in['userid'] . " AND activator = '" . $bugsys->input_escape('activator') . "'"))
+ $input->inputClean('userid', TYPE_UINT);
+ if ($useractivation = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $input->in['userid'] . " AND activator = '" . $input->inputEscape('activator') . "'"))
{
- $user = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $bugsys->in['userid']);
- $db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = $useractivation[usergroupid] WHERE userid = " . $bugsys->in['userid']);
- $db->query("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $bugsys->in['userid']);
+ $user = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $input->in['userid']);
+ $db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = $useractivation[usergroupid] WHERE userid = " . $input->in['userid']);
+ $db->query("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $input->in['userid']);
- if ($bugsys->options['sendwelcomemail'])
+ if (bugdar::$options['sendwelcomemail'])
{
$displayName = $user['displayname'];
- eval('$email = "' . $template->fetch(FetchEmailPath('welcome.xml', $bugsys->datastore['language'][$user['languageid']]['langcode'])) . '";');
- $email = $bugsys->xml->parse($email);
- $mail->setSubject($email['email']['subject']['value']);
- $mail->setBodyText($email['email']['bodyText']['value']);
+
+ $email = get_email_text('welcome');
+ $mail = new BSMail();
+ $mail->setSubject($email['subject']);
+ $mail->setBodyText(sprintf($email['bodyText'], $user['displayname'], bugdar::$options['trackertitle']));
+ $mail->setFromAddress(MAIL_FROM_ADDRESS);
+ $mail->setFromName(MAIL_FROM_NAME);
$mail->send($user['email'], $user['displayname']);
}
}
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
'pagenav'
);
-define('SVN', '$Id$');
$focus['search'] = 'focus';
require_once('./includes/class_sort.php');
require_once('./includes/class_logging.php');
require_once('./includes/api_bug.php');
-require_once('./includes/class_api_error.php');
-
-APIError(array($message, 'error'));
if (!can_perform('cansearch'))
{
define('MODE_ALL', 2);
define('MODE_RAW', 3);
-$var = $db->query_first("SHOW VARIABLES LIKE 'ft_min_word_len'");
+$var = $db->queryFirst("SHOW VARIABLES LIKE 'ft_min_word_len'");
define('SEARCH_WORD_MIN', $var['Value']);
$db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE userid = 0 AND dateline < " . (TIMENOW - 3600));
if ($_REQUEST['do'] == 'search')
{
- if ($bugsys->in['new'])
+ if ($input->in['new'])
{
$newsearch = true;
}
- else if ($bugsys->in['searchid'])
+ else if ($input->in['searchid'])
{
- $cachedsearch = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']);
+ $cachedsearch = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']);
}
- else if ($bugsys->userinfo['userid'])
+ else if (bugdar::$userinfo['userid'])
{
- $cachedsearch = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . $bugsys->userinfo['userid']);
+ $cachedsearch = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . bugdar::$userinfo['userid']);
}
else
{
if ($cachedsearch)
{
$show['cached'] = true;
- if ($cachedsearch['dateline'] < TIMENOW - 900 OR $bugsys->in['rerun'])
+ if ($cachedsearch['dateline'] < TIMENOW - 900 OR $input->in['rerun'])
{
$_REQUEST['do'] = 'process';
- $bugsys->in = array_merge(unserialize($cachedsearch['query']), $bugsys->in);
- $bugsys->debug('rerunning the search');
+ $input->in = array_merge(unserialize($cachedsearch['query']), $input->in);
+ BSApp::debug('rerunning the search');
}
else
{
if ($newsearch)
{
- if (!is_array($bugsys->datastore['product']))
+ if (!is_array(bugdar::$datastore['product']))
{
$message->error(T('No products are setup, therefore there can be no bugs and thus search cannot function.'));
}
- if (!is_array($bugsys->datastore['version']))
+ if (!is_array(bugdar::$datastore['version']))
{
$message->error(T('No versions have been added underneath your product(s), there can be no bugs and thus search cannot function.'));
}
- $productSelect = ConstructProductSelect();
-
// -------------------------------------------------------------------
// custom fields
$fields = construct_custom_fields(null, true, false, true);
$select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid');
$searches = '';
- if ($bugsys->userinfo['userid'])
+ if (bugdar::$userinfo['userid'])
{
- $searchesFetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NOT NULL AND userid = " . $bugsys->userinfo['userid']);
- while ($search = $db->fetch_array($searchesFetch))
+ $searchesFetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NOT NULL AND userid = " . bugdar::$userinfo['userid']);
+ foreach ($searchesFetch as $search)
{
- $value = $search['searchid'];
- $label = $search['name'];
- eval('$searches .= "' . $template->fetch('selectoption') . '";');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'value' => $search['searchid'],
+ 'label' => $search['name']
+ );
+ $searches .= $tpl->evaluate()->getTemplate();
}
}
$select['dev'] = '';
- foreach ($bugsys->datastore['assignto'] AS $dev)
+ foreach (bugdar::$datastore['assignto'] AS $dev)
{
- $value = $dev['userid'];
- $label = construct_user_display($dev, false);
- eval('$select[dev] .= "' . $template->fetch('selectoption') . '";');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'value' => $dev['userid'],
+ 'label' => construct_user_display($dev, false)
+ );
+ $select['dev'] .= $tpl->evaluate()->getTemplate();
}
-
- eval('$template->flush("' . $template->fetch('search') . '");');
+
+ $tpl = new BSTemplate('search');
+ $tpl->vars = array(
+ 'select' => $select,
+ 'productSelect' => construct_product_select(),
+ 'customfields' => $customfields,
+ 'searches' => $searches
+ );
+ $tpl->evaluate()->flush();
}
}
{
// -------------------------------------------------------------------
// handle keywords
- if ($bugsys->in['summary'])
+ if ($input->in['summary'])
{
- $keywords = preg_split('#\s+#', $bugsys->in['summary']);
+ $keywords = preg_split('#\s+#', $input->in['summary']);
// TODO - need to have some str to bool conversions
continue;
}
- if ($bugsys->in['mode'] == MODE_ALL)
+ if ($input->in['mode'] == MODE_ALL)
{
$querybuild['text'] .= " +$word";
}
$temp = trim($querybuild['text']);
- if ($bugsys->in['mode'] == MODE_ALL OR $bugsys->in['mode'] == MODE_RAW)
+ if ($input->in['mode'] == MODE_ALL OR $input->in['mode'] == MODE_RAW)
{
$bool_flag = ' IN BOOLEAN MODE';
}
// -------------------------------------------------------------------
// reporter
- if ($bugsys->in['reporter'])
+ if ($input->in['reporter'])
{
// force email or name?? make a distinction?
// more elegant way to do this? probably
- $user = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE email LIKE '%" . str_replace('%', '\%', $bugsys->input_escape('reporter')) . "' OR displayname LIKE '%" . str_replace('%', '\%', $bugsys->input_escape('reporter')) . "%'");
+ $user = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE email LIKE '%" . str_replace('%', '\%', $input->inputEscape('reporter')) . "' OR displayname LIKE '%" . str_replace('%', '\%', $input->inputEscape('reporter')) . "%'");
if ($user['userid'])
{
$querybuild['reporter'] = "AND bug.userid = $user[userid] OR comment.userid = $user[userid]";
// -------------------------------------------------------------------
// product/component/version stuff
- if (is_array($bugsys->in['product']))
+ if (is_array($input->in['product']))
{
- foreach ($bugsys->in['product'] AS $prod)
+ foreach ($input->in['product'] AS $prod)
{
$product = explode(',', $prod);
- $product = $bugsys->clean($product, TYPE_UINT);
+ $product = $input->clean($product, TYPE_UINT);
$products[] = $product[0];
$components[] = $product[1];
$versions[] = $product[2];
// severity, priority, status, resolution, assignedto
// severity
- if ($bugsys->in['severity'])
+ if ($input->in['severity'])
{
- $bugsys->input_clean('severity', TYPE_UINT);
- $querybuild['severity'] = "AND bug.severity IN (" . implode(',', $bugsys->in['severity']) . ")";
+ $input->inputClean('severity', TYPE_UINT);
+ $querybuild['severity'] = "AND bug.severity IN (" . implode(',', $input->in['severity']) . ")";
}
// priority
- if ($bugsys->in['priority'])
+ if ($input->in['priority'])
{
- $bugsys->input_clean('priority', TYPE_UINT);
- $querybuild['priority'] = "AND bug.priority IN (" . implode(',', $bugsys->in['priority']) . ")";
+ $input->inputClean('priority', TYPE_UINT);
+ $querybuild['priority'] = "AND bug.priority IN (" . implode(',', $input->in['priority']) . ")";
}
// status
- if ($bugsys->in['status'])
+ if ($input->in['status'])
{
- $bugsys->input_clean('status', TYPE_UINT);
- $querybuild['status'] = "AND bug.status IN (" . implode(',', $bugsys->in['status']) . ")";
+ $input->inputClean('status', TYPE_UINT);
+ $querybuild['status'] = "AND bug.status IN (" . implode(',', $input->in['status']) . ")";
}
// resolution
- if ($bugsys->in['resolution'])
+ if ($input->in['resolution'])
{
- $bugsys->input_clean('resolution', TYPE_UINT);
- $querybuild['resolution'] = "AND bug.resolution IN (" . implode(',', $bugsys->in['resolution']) . ")";
+ $input->inputClean('resolution', TYPE_UINT);
+ $querybuild['resolution'] = "AND bug.resolution IN (" . implode(',', $input->in['resolution']) . ")";
}
// assignment
- if ($bugsys->in['assignedto'])
+ if ($input->in['assignedto'])
{
- $bugsys->input_clean('assignedto', TYPE_UINT);
- $querybuild['assignedto'] = "AND bug.assignedto IN (" . implode(',', $bugsys->in['assignedto']) . ")";
+ $input->inputClean('assignedto', TYPE_UINT);
+ $querybuild['assignedto'] = "AND bug.assignedto IN (" . implode(',', $input->in['assignedto']) . ")";
}
// -------------------------------------------------------------------
// date
- if ($bugsys->in['date'])
+ if ($input->in['date'])
{
// now - (seconds/day * number of days)
- $dateline = time() - ($bugsys->input_clean('date', TYPE_INT) * 3600);
+ $dateline = time() - ($input->inputClean('date', TYPE_INT) * 3600);
$querybuild['date'] = "AND bug.dateline >= $dateline";
}
// -------------------------------------------------------------------
// favorites
- $bugsys->input_clean('favorite', TYPE_INT);
- if ($bugsys->in['favorite'] != 0 AND $bugsys->userinfo['userid'])
+ $input->inputClean('favorite', TYPE_INT);
+ if ($input->in['favorite'] != 0 AND bugdar::$userinfo['userid'])
{
- $favorites = $db->query("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid']);
- while ($favorite = $db->fetch_array($favorites))
+ $favorites = $db->query("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . bugdar::$userinfo['userid']);
+ foreach ($favorites as $favorite)
{
$ids[] = $favorite['bugid'];
}
- $querybuild['favorites'] = "AND bug.bugid " . ($bugsys->in['favorite'] > 0 ? "IN" : "NOT IN") . " (" . implode(', ', $ids) . ")";
+ $querybuild['favorites'] = "AND bug.bugid " . ($input->in['favorite'] > 0 ? "IN" : "NOT IN") . " (" . implode(', ', $ids) . ")";
}
// -------------------------------------------------------------------
// sort by
$sortby = array('bugid', 'severity', 'priority', 'status', 'resolution', 'dateline');
$orderby = array('ASC', 'DESC');
- $bugsys->in['orderby'] = strtoupper($bugsys->in['orderby']);
- if (in_array($bugsys->in['sortby'], $sortby) AND in_array($bugsys->in['orderby'], $orderby))
+ $input->in['orderby'] = strtoupper($input->in['orderby']);
+ if (in_array($input->in['sortby'], $sortby) AND in_array($input->in['orderby'], $orderby))
{
- $sortclause = "ORDER BY " . $bugsys->in['sortby'] . ' ' . $bugsys->in['orderby'];
+ $sortclause = "ORDER BY " . $input->in['sortby'] . ' ' . $input->in['orderby'];
}
- else if ($bugsys->in['sortby'] == 'relevance')
+ else if ($input->in['sortby'] == 'relevance')
{
$sortclause = '';
}
// -------------------------------------------------------------------
// custom fields
- $fields_fetch = $bugsys->db->query("
+ $fields_fetch = $db->query("
SELECT bugfield.*, MAX(permission.mask) AS mask
FROM " . TABLE_PREFIX . "bugfield AS bugfield
LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission
ON (bugfield.fieldid = permission.fieldid)
WHERE mask <> 0
- AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ")
+ AND permission.usergroupid IN (" . bugdar::$userinfo['usergroupid'] . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ")
AND bugfield.cansearch = 1
GROUP BY (bugfield.fieldid)"
);
- while ($field = $bugsys->db->fetch_array($fields_fetch))
+ foreach ($fields_fetch as $field)
{
- if (!empty($bugsys->in["custom$field[fieldid]"]) OR ($field['type'] == 'select_single' AND isset($bugsys->in["custom$field[fieldid]"])))
+ if (!empty($input->in["custom$field[fieldid]"]) OR ($field['type'] == 'select_single' AND isset($input->in["custom$field[fieldid]"])))
{
- if ($field['type'] == 'input_checkbox' AND $bugsys->input_clean("custom$field[fieldid]", TYPE_INT) != 0)
+ if ($field['type'] == 'input_checkbox' AND $input->inputClean("custom$field[fieldid]", TYPE_INT) != 0)
{
- $querybuild[] = "AND bug.custom$field[fieldid] = " . ($bugsys->in["custom$field[fieldid]"] > 0 ? 1 : 0);
+ $querybuild[] = "AND bug.custom$field[fieldid] = " . ($input->in["custom$field[fieldid]"] > 0 ? 1 : 0);
}
else if ($field['type'] == 'input_text')
{
- $querybuild[] = "AND bug.custom$field[fieldid] LIKE '%" . $bugsys->in["custom$field[fieldid]"] . "%'";
+ $querybuild[] = "AND bug.custom$field[fieldid] LIKE '%" . $input->in["custom$field[fieldid]"] . "%'";
}
- else if ($field['type'] == 'select_single' AND $bugsys->in["custom$field[fieldid]"] != -1)
+ else if ($field['type'] == 'select_single' AND $input->in["custom$field[fieldid]"] != -1)
{
$temp = unserialize($field['selects']);
- $querybuild[] = "AND bug.custom$field[fieldid] = '" . trim($temp[ intval($bugsys->in["custom$field[fieldid]"]) ]) . "'";
+ $querybuild[] = "AND bug.custom$field[fieldid] = '" . trim($temp[ intval($input->in["custom$field[fieldid]"]) ]) . "'";
}
}
}
OR
(bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? "
OR
- (bug.hidden AND bug.userid = " . $bugsys->userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewonhidden') . "))" : "") . "
+ (bug.hidden AND bug.userid = " . bugdar::$userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewonhidden') . "))" : "") . "
)
" . implode("\n\t\t", $querybuild) . "
GROUP BY bug.bugid
$sortclause
");
- $numrows = $db->num_rows($search);
+ $numrows = $search->size();
if ($numrows < 1)
{
$message->error(T('No search results were returned that matched your criteria. Please <a href="search.php?new=1">try again</a> with different search requirements.'));
}
- while ($result = $db->fetch_array($search))
+ foreach ($search as $result)
{
$ids[] = $result['bugid'];
$results[] = $result;
}
- if ($bugsys->userinfo['userid'] AND !$cachedsearch AND !$bugsys->in['rerun'])
+ if (bugdar::$userinfo['userid'] AND !$cachedsearch AND !$input->in['rerun'])
{
- $db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE userid = " . $bugsys->userinfo['userid'] . " AND name IS NULL");
+ $db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE userid = " . bugdar::$userinfo['userid'] . " AND name IS NULL");
}
// store the search params
- $params = $bugsys->in;
+ $params = $input->in;
foreach ($_COOKIE AS $key => $value)
{
unset($params["$key"]);
INSERT INTO " . TABLE_PREFIX . "search
(userid, dateline, query, ids, orderby, hilight, resultcount)
VALUES
- (" . $bugsys->userinfo['userid'] . ",
- " . TIMENOW . ", '" . $bugsys->escape(serialize($params)) . "',
- '" . implode(',', $ids) . "', '" . $bugsys->escape($sortclause) . "',
- '" . $bugsys->escape($hilight) . "',
+ (" . bugdar::$userinfo['userid'] . ",
+ " . TIMENOW . ", '" . $input->escape(serialize($params)) . "',
+ '" . implode(',', $ids) . "', '" . $input->escape($sortclause) . "',
+ '" . $input->escape($hilight) . "',
" . sizeof($results) . "
)"
);
- $search = array('searchid' => $db->insert_id(), 'ids' => implode(',', $ids), 'orderby' => $sortclause, 'hilight' => $hilight, 'resultcount' => sizeof($results));
+ $search = array('searchid' => $db->insertId(), 'ids' => implode(',', $ids), 'orderby' => $sortclause, 'hilight' => $hilight, 'resultcount' => sizeof($results));
}
$_POST['do'] = 'results';
if ($_REQUEST['do'] == 'update')
{
- $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']);
+ $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']);
if (!$search OR !can_perform('caneditother'))
{
$message->errorPermission();
}
- $productSelect = ConstructProductSelect();
-
$show['update'] = true;
// -------------------------------------------------------------------
$select['status'] = construct_datastore_select('status', 'status', 'statusid', 0, 0);
$select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid', 0, 0);
- $select['dev'] = '';
- $value = '0';
- $label = '';
- $selected = true;
- eval('$select[dev] .= "' . $template->fetch('selectoption') . '";');
- $selected = false;
- foreach ($bugsys->datastore['assignto'] AS $dev)
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'value' => 0,
+ 'label' => '',
+ 'selected' => true
+ );
+ $select['dev'] = $tpl->evaluate()->getTemplate();
+
+ foreach (bugdar::$datastore['assignto'] as $dev)
{
- $value = $dev['userid'];
- $label = construct_user_display($dev, false);
- eval('$select[dev] .= "' . $template->fetch('selectoption') . '";');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'value' => $dev['userid'],
+ 'label' => construct_user_display($dev, false)
+ );
+ $select['dev'] .= $tpl->evaluate()->getTemplate();
}
-
- eval('$template->flush("' . $template->fetch('search_update') . '");');
+
+ $tpl = new BSTemplate('search_update');
+ $tpl->vars = array(
+ 'search' => $search,
+ 'select' => $select,
+ 'customfields' => $customfields,
+ 'productSelect' => construct_product_select()
+ );
+ $tpl->evaluate()->flush();
}
// ###################################################################
if ($_POST['do'] == 'doupdate')
{
- $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']);
+ $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']);
if (!$search OR !can_perform('caneditother'))
{
$message->errorPermission();
(
product IN (" . fetch_on_bits('caneditother') . ")
OR
- (userid = " . $bugsys->userinfo['userid'] . " AND product IN (" . fetch_on_bits('caneditown') . "))
+ (userid = " . bugdar::$userinfo['userid'] . " AND product IN (" . fetch_on_bits('caneditown') . "))
)
");
- while ($bug = $db->fetch_array($bugs))
+ foreach ($bugs as $bug)
{
- if (!((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid'])) AND !can_perform('canpostcomments', $bug['product']))
+ if (!((can_perform('caneditown', $bug['product']) AND bugdar::$userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND bugdar::$userinfo['userid'] != $bug['userid'])) AND !can_perform('canpostcomments', $bug['product']))
{
continue;
}
- $api = new BugApi($bugsys);
+ $api = new BugApi();
$api->set('bugid', $bug['bugid']);
- $api->set_condition();
$api->values = $bug;
$log = new Logging();
- $log->set_bugid($bug['bugid']);
- $log->add_data(true, $bug, $log->getCommonFields(), true);
+ $log->setBugId($bug['bugid']);
+ $log->addData(true, $bug, $log->getCommonFields(), true);
- if ($bugsys->in['status'] AND can_perform('canchangestatus', $bug['product']))
+ if ($input->in['status'] AND can_perform('canchangestatus', $bug['product']))
{
- $api->set('status', $bugsys->in['status']);
+ $api->set('status', $input->in['status']);
}
- if ($bugsys->in['priority'] AND can_perform('canchangestatus', $bug['product']))
+ if ($input->in['priority'] AND can_perform('canchangestatus', $bug['product']))
{
- $api->set('priority', $bugsys->in['priority']);
+ $api->set('priority', $input->in['priority']);
}
- if ($bugsys->in['severity'])
+ if ($input->in['severity'])
{
- $api->set('severity', $bugsys->in['severity']);
+ $api->set('severity', $input->in['severity']);
}
- if ($bugsys->in['resolution'] AND can_perform('canchangestatus', $bug['product']))
+ if ($input->in['resolution'] AND can_perform('canchangestatus', $bug['product']))
{
- $api->set('resolution', $bugsys->in['resolution']);
+ $api->set('resolution', $input->in['resolution']);
}
- if ($bugsys->in['assignedto'] AND can_perform('canassign', $bug['product']))
+ if ($input->in['assignedto'] AND can_perform('canassign', $bug['product']))
{
- $api->set('assignedto', $bugsys->in['assignedto']);
+ $api->set('assignedto', $input->in['assignedto']);
}
- if ($bugsys->in['product'])
+ if ($input->in['product'])
{
- $product = explode(',', $bugsys->in['product']);
+ $product = explode(',', $input->in['product']);
$api->set('product', $product[0]);
$api->set('component', $product[1]);
$api->set('version', $product[2]);
process_custom_fields($api, $message, false, true);
- $log->add_data(false, $api->values, $log->getCommonFields(), true);
+ $log->addData(false, $api->values, $log->getCommonFields(), true);
$api->update();
- $log->update_history();
+ $log->updateHistory();
}
- $message->redirect(T('The specified bugs have been updated and you will now return to your search results.'), 'search.php?searchid=' . $bugsys->in['searchid']);
+ $message->redirect(T('The specified bugs have been updated and you will now return to your search results.'), 'search.php?searchid=' . $input->in['searchid']);
}
// ###################################################################
if ($_REQUEST['do'] == 'export')
{
- if (!$bugsys->in['searchid'] AND $bugsys->userinfo['userid'])
+ if (!$input->in['searchid'] AND bugdar::$userinfo['userid'])
{
- $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . $bugsys->userinfo['userid']);
+ $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . bugdar::$userinfo['userid']);
}
- else if ($bugsys->in['searchid'])
+ else if ($input->in['searchid'])
{
- $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']);
+ $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']);
}
else
{
$xml = '<?xml version="1.0" encoding="' . $language['charset'] . '"?>
-<bugdarExport user="' . $bugsys->unsanitize(construct_user_display($bugsys->userinfo, false)) . '" date="' . $datef->format('r', TIMENOW) . '" searchid="' . $search['searchid'] . '">';
+<bugdarExport user="' . $input->unsanitize(construct_user_display(bugdar::$userinfo, false)) . '" date="' . $datef->format('r', TIMENOW) . '" searchid="' . $search['searchid'] . '">';
- while ($bug = $db->fetch_array($bugs))
+ foreach ($bugs as $bug)
{
$xml .= "\n\t<bug>";
$xml .= "\n\t\t<dateReported>" . $datef->format('r', $bug['dateline']) . "</dateReported>";
if ($bug['userid'])
{
- $xml .= "\n\t\t<reporter>" . construct_user_display($db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = $bug[userid]"), false) . "</reporter>";
+ $xml .= "\n\t\t<reporter>" . construct_user_display($db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = $bug[userid]"), false) . "</reporter>";
}
$xml .= "\n\t\t<summary>" . $bug['summary'] . "</summary>";
$xml .= "\n\t\t<product>" . $bug['product'] . "</product>";
$xml .= "\n\t\t<status>" . $bug['status'] . "</status>";
if ($bug['assignedto'])
{
- $xml .= "\n\t\t<assignedTo>" . construct_user_display($bugsys->datastore['assignto']["$bug[assignedto]"], false) . "</assignedTo>";
+ $xml .= "\n\t\t<assignedTo>" . construct_user_display(bugdar::$datastore['assignto']["$bug[assignedto]"], false) . "</assignedTo>";
}
$xml .= "\n\t\t<resolution>" . $bug['resolution'] . "</resolution>";
$xml .= "\n\t\t<severity>" . $bug['severity'] . "</severity>";
$xml .= "\n</bugdarExport>";
- $funct->download_file($xml, T('bugdar-search-' . $search['searchid'] . '.xml'), true);
+ BSFunctions::download_file($xml, T('bugdar-search-' . $search['searchid'] . '.xml'), true);
}
// ###################################################################
if ($_POST['do'] == 'dosave')
{
- $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']);
+ $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']);
if (!$search)
{
$message->addError(T('The search does not exist.'));
{
$message->addError(sprintf(T('This search has already been named "%1$s".'), $search['name']));
}
- if (empty($bugsys->in['name']))
+ if (empty($input->in['name']))
{
$message->addError(T('The name cannot be empty.'));
}
if (!$message->hasErrors())
{
- $db->query("UPDATE " . TABLE_PREFIX . "search SET name = '" . $bugsys->input_escape('name') . "' WHERE searchid = " . $bugsys->in['searchid']);
+ $db->query("UPDATE " . TABLE_PREFIX . "search SET name = '" . $input->inputEscape('name') . "' WHERE searchid = " . $input->in['searchid']);
$message->redirect(T('Your search has been saved.'), 'search.php?searchid=' . $search['searchid']);
}
else
if ($_REQUEST['do'] == 'save')
{
- if (!$bugsys->userinfo['userid'])
+ if (!bugdar::$userinfo['userid'])
{
$message->errorPermission();
}
- eval('$template->flush("' . $template->fetch('search_save') . '");');
+ $tpl = new BSTemplate('search_save');
+ $tpl->vars = array(
+ 'message' => $message,
+ 'searchid' => $input->in['searchid'],
+ 'name' => $input->in['name']
+ );
+ $tpl->evaluate()->flush();
}
// ###################################################################
$searchid = $search['searchid'];
$hilight = $search['hilight'];
-
- LoadPaginationFramework();
+
+ require_once 'includes/pagination.php';
+ $pagination = new Pagination();
+ $pagination->processIncomingData();
$pagination->setTotal($search['resultcount']);
$pagination->splitPages();
$sort = new ListSorter('search');
- $show['save'] = ($bugsys->userinfo['userid'] AND !$search['name']);
+ $show['save'] = (bugdar::$userinfo['userid'] AND !$search['name']);
$show['update'] = can_perform('caneditother');
$bugs = '';
$search = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid IN ($search[ids]) $search[orderby] LIMIT " . $pagination->fetchLimit($pagination->getPage() - 1) . ", " . $pagination->getPerPage());
- while ($bug = $db->fetch_array($search))
+ foreach ($search as $bug)
{
- $funct->exec_swap_bg('altcolor', '');
- $bug = ProcessBugDataForDisplay($bug, $funct->bgcolour);
+ BSFunctions::swap_css_classes('altcolor', '');
+ $bug = ProcessBugDataForDisplay($bug, BSFunctions::$cssClass);
$bugs .= $sort->constructRow($bug, "&hilight=$hilight");
}
$show['pagenav'] = ($pagination->getPageCount() > 1);
$pagenav = $pagination->constructPageNav('search.php?searchid=' . $searchid);
- eval('$template->flush("' . $template->fetch('search_results') . '");');
+ $tpl = new BSTemplate('search_results');
+ $tpl->vars = array(
+ 'columnHeads' => $columnHeads,
+ 'bugs' => $bugs,
+ 'searchid' => $searchid
+ );
+ $tpl->evaluate()->flush();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'history_bit'
);
-define('SVN', '$Id$');
$focus['showreport'] = 'focus';
require_once('./global.php');
require_once('./includes/api_user.php');
-$bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $bugsys->input_clean('bugid', TYPE_UINT));
+$bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $input->inputClean('bugid', TYPE_UINT));
if (!$bug)
{
$message->error(L_INVALID_ID);
LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission
ON (bugfield.fieldid = permission.fieldid)
WHERE mask <> 0
- AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ")
+ AND permission.usergroupid IN (" . bugdar::$userinfo['usergroupid'] . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ")
GROUP BY (bugfield.fieldid)"
);
-while ($field = $db->fetch_array($customfields))
+foreach ($customfields as $field)
{
$fieldlist["$field[fieldid]"] = sprintf(T('Custom Field %1$s (%2$s)'), $field['fieldid'], $field['name']);
}
ON (user.userid = history.userid)
WHERE bugid = $bug[bugid]"
);
-while ($log = $db->fetch_array($logs_fetch))
+foreach ($logs_fetch as $log)
{
- $log['date'] = $datef->format($bugsys->options['dateformat'], $log['dateline']);
+ $log['date'] = $datef->format(bugdar::$options['dateformat'], $log['dateline']);
$log['user'] = construct_user_display($log);
$logs["$log[dateline]"]["$log[historyid]"] = $log;
if (isset($lookupfields["$matches[1]"]))
{
$lookup = $matches[1];
- $log['original'] = $bugsys->datastore["$lookup"]["$log[original]"][ $lookupfields["$lookup"] ];
- $log['changed'] = $bugsys->datastore["$lookup"]["$log[changed]"][ $lookupfields["$lookup"] ];
+ $log['original'] = bugdar::$datastore["$lookup"]["$log[original]"][ $lookupfields["$lookup"] ];
+ $log['changed'] = bugdar::$datastore["$lookup"]["$log[changed]"][ $lookupfields["$lookup"] ];
}
else if ($matches[1] == 'assignto' OR $matches[1] == 'assignedto')
{
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);
}
}
}
- $funct->exec_swap_bg('', 'altcolor');
- $bgcolor = $funct->bgcolour;
+ BSFunctions::swap_css_classes('', 'altcolor');
- 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;
}
}
$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();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'bugfield_static_text'
);
-define('SVN', '$Id$');
$focus['showreport'] = 'focus';
require_once('./global.php');
require_once('./includes/functions_product.php');
-$bugid = $bugsys->input_clean('bugid', TYPE_UINT);
+$bugid = $input->inputClean('bugid', TYPE_UINT);
// ###################################################################
{
if (!empty($bugid))
{
- if ($db->query_first("SELECT bugid FROM " . TABLE_PREFIX . "bug WHERE bugid = $bugid"))
+ if ($db->queryFirst("SELECT bugid FROM " . TABLE_PREFIX . "bug WHERE bugid = $bugid"))
{
header("Location: showreport.php?bugid=$bugid");
exit;
}
}
- eval('$template->flush("' . $template->fetch('quicksearch') . '");');
+ $tpl = new BSTemplate('quicksearch');
+ $tpl->vars = array('error' => $error);
+ $tpl->evaluate()->flush();
exit;
}
// -------------------------------------------------------------------
// get the report
-$bug = $db->query_first("
+$bug = $db->queryFirst("
SELECT bug.*, user.email, user.displayname, user.showemail
FROM " . TABLE_PREFIX . "bug AS bug
LEFT JOIN " . TABLE_PREFIX . "user AS user
$message->errorPermission();
}
-$show['edit'] = ((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid'] AND $bug['userid'] != 0) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid']));
+$show['edit'] = ((can_perform('caneditown', $bug['product']) AND bugdar::$userinfo['userid'] == $bug['userid'] AND $bug['userid'] != 0) OR (can_perform('caneditother', $bug['product']) AND bugdar::$userinfo['userid'] != $bug['userid']));
$show['delete'] = can_perform('candeletedata', $bug['product']);
// ###################################################################
}
else
{
- $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status'];
- $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution'];
- $bug['severity'] = $bugsys->datastore['severity']["$bug[severity]"]['severity'];
- $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority'];
+ $bug['status'] = bugdar::$datastore['status']["$bug[status]"]['status'];
+ $bug['resolution'] = bugdar::$datastore['resolution']["$bug[resolution]"]['resolution'];
+ $bug['severity'] = bugdar::$datastore['severity']["$bug[severity]"]['severity'];
+ $bug['priority'] = bugdar::$datastore['priority']["$bug[priority]"]['priority'];
}
- $show['assign'] = (can_perform('canassign', $bug['product']) ? true : false);
- if (can_perform('canassign', $bug['product']) AND is_array($bugsys->datastore['assignto']))
+ $show['assign'] = (can_perform('canassign', $bug['product']));
+ if (can_perform('canassign', $bug['product']) && is_array(bugdar::$datastore['assignto']))
{
- foreach ($bugsys->datastore['assignto'] AS $dev)
+ foreach (bugdar::$datastore['assignto'] as $dev)
{
- $value = $dev['userid'];
- $selected = (($dev['userid'] == $bug['assignedto']) ? true : false);
- $label = construct_user_display($dev, false);
- eval('$select[dev] .= "' . $template->fetch('selectoption') . '";');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'value' => $dev['userid'],
+ 'label' => construct_user_display($dev, false),
+ 'selected' => ($dev['userid'] == $bug['assignedto'])
+ );
+ $select['dev'] .= $tpl->evaluate()->getTemplate();
}
}
- $productSelect = ConstructProductSelect('canviewbugs', "$bug[product],$bug[component],$bug[version]");
+ $productSelect = construct_product_select('canviewbugs', "$bug[product],$bug[component],$bug[version]");
if ($bug['duplicateof'])
{
- $duplicate = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]");
+ $duplicate = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]");
}
if ($bug['dependency'])
{
$depends = array();
$dependencies = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid IN ($bug[dependency])");
- while ($dependency = $db->fetch_array($dependencies))
+ foreach ($dependencies as $dependency)
{
$depends[] = "<a href=\"showreport.php?bugid=$dependency[bugid]\" title=\"$dependency[summary]\">$dependency[bugid]</a>";
}
$select['automations'] = '';
$show['automations'] = false;
- if (is_array($bugsys->datastore['automation']))
+ if (is_array(bugdar::$datastore['automation']))
{
- foreach ($bugsys->datastore['automation'] AS $action)
+ foreach (bugdar::$datastore['automation'] as $action)
{
- $label = $action['name'];
- $value = $action['actionid'];
- $selected = false;
- eval('$select[automation] .= "' . $template->fetch('selectoption') . '";');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'label' => $action['name'],
+ 'value' => $action['actionid'],
+ 'selected' => false
+ );
+ $select['automation'] .= $tpl->evaluate()->getTemplate();
$show['automations'] = true;
}
if ($show['automations'])
{
- $label = '';
- $value = 0;
- $selected = true;
- eval('$select[automation] = "' . $template->fetch('selectoption') . '" . $select[automation];');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'label' => '',
+ 'value' => 0,
+ 'selected' => true
+ );
+ $select['automation'] = $tpl->evaluate()->getTemplate() . $select['automation'];
}
}
}
{
// -------------------------------------------------------------------
// prep display
- $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status'];
- $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution'];
- $bug['severity'] = $bugsys->datastore['severity']["$bug[severity]"]['severity'];
- $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority'];
+ $bug['status'] = bugdar::$datastore['status']["$bug[status]"]['status'];
+ $bug['resolution'] = bugdar::$datastore['resolution']["$bug[resolution]"]['resolution'];
+ $bug['severity'] = bugdar::$datastore['severity']["$bug[severity]"]['severity'];
+ $bug['priority'] = bugdar::$datastore['priority']["$bug[priority]"]['priority'];
- $assigninfo = $bugsys->datastore['assignto']["$bug[assignedto]"];
+ $assigninfo = bugdar::$datastore['assignto']["$bug[assignedto]"];
$bug['assigninfo'] = ((is_array($assigninfo)) ? construct_user_display($assigninfo) : '');
- $duplicateof = $db->query_first("SELECT bugid, summary FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]");
+ $duplicateof = $db->queryFirst("SELECT bugid, summary FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]");
$dupelist = array();
$duplicates = $db->query("SELECT bugid, summary FROM " . TABLE_PREFIX . "bug WHERE duplicateof = $bug[bugid]");
- while ($duplicate = $db->fetch_array($duplicates))
+ foreach ($duplicates as $duplicate)
{
$dupelist[] = "<a href=\"showreport.php?bugid=$duplicate[bugid]\" target=\"_blank\">$duplicate[summary]</a>";
}
{
$depends = array();
$dependencies = $db->query("SELECT bugid, summary FROM " . TABLE_PREFIX . "bug WHERE bugid IN ($bug[dependency])");
- while ($dependency = $db->fetch_array($dependencies))
+ foreach ($dependencies as $dependency)
{
$depends[] = "<a href=\"showreport.php?bugid=$dependency[bugid]\" title=\"$dependency[summary]\" target=\"_blank\">$dependency[bugid]</a>";
}
$show['subscribe'] = can_perform('cansubscribe', $bug['product']);
-$favorite = (bool)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE bugid = $bug[bugid] AND userid = " . $bugsys->userinfo['userid']);
+$favorite = (bool)$db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE bugid = $bug[bugid] AND userid = " . bugdar::$userinfo['userid']);
$favoritetext = ($favorite ? T('Remove from Favorites') : T('Add to Favorites'));
$bug['userinfo'] = construct_user_display($bug);
-$bug['datetime'] = $datef->format($bugsys->options['dateformat'], $bug['dateline']);
+$bug['datetime'] = $datef->format(bugdar::$options['dateformat'], $bug['dateline']);
$bug['productid'] = $bug['product'];
-$bug['product'] = $bugsys->datastore['product']["$bug[product]"]['title'];
+$bug['product'] = bugdar::$datastore['product']["$bug[product]"]['title'];
$bug['componentid'] = $bug['component'];
-$bug['component'] = ($bug['component'] ? $bugsys->datastore['product']["$bug[component]"]['title'] : '');
+$bug['component'] = ($bug['component'] ? bugdar::$datastore['product']["$bug[component]"]['title'] : '');
$bug['versionid'] = $bug['version'];
-$bug['version'] = $bugsys->datastore['version']["$bug[version]"]['version'];
+$bug['version'] = bugdar::$datastore['version']["$bug[version]"]['version'];
// ###################################################################
// custom field output
// -------------------------------------------------------------------
// hilight
-$words = explode(' ', $bugsys->in['hilight']);
+$words = explode(' ', $input->in['hilight']);
foreach ($words AS $word)
{
if (trim($word))
{
- $word = preg_quote($bugsys->unsanitize($word));
+ $word = preg_quote($input->unsanitize($word));
$hilight[] = $temp = trim(preg_replace('#[^0-9a-zA-Z_ ]#', '', $word));
}
}
// -------------------------------------------------------------------
// attachments
-$show['getattachments'] = ((can_perform('cangetattach', $bug['productid']) OR can_perform('caneditattach', $bug['productid'])) ? true : false);
-$show['putattachments'] = ((can_perform('canputattach', $bug['productid']) OR can_perform('caneditattach', $bug['productid'])) ? true : false);
-$show['attachments'] = ($show['getattachments'] OR $show['putattachments']) ? true : false;
+$show['getattachments'] = (can_perform('cangetattach', $bug['productid']) || can_perform('caneditattach', $bug['productid']));
+$show['putattachments'] = (can_perform('canputattach', $bug['productid']) || can_perform('caneditattach', $bug['productid']));
+$show['attachments'] = ($show['getattachments'] || $show['putattachments']);
-if ($show['getattachments'] OR $show['putattachments'])
+if ($show['getattachments'] || $show['putattachments'])
{
$attachments_fetch = $db->query("
SELECT attachment.attachmentid, attachment.filename,
);
$attaches = false;
- while ($attachment = $db->fetch_array($attachments_fetch))
+ foreach ($attachments_fetch as $attachment)
{
$attaches = true;
- $show['editattach'] = ((can_perform('caneditattach', $bug['productid']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['productid']))) ? true : false);
- $attachment['date'] = $datef->format($bugsys->options['dateformat'], $attachment['dateline']);
+ $show['editattach'] = (can_perform('caneditattach', $bug['productid']) || ($attachment['userid'] == bugdar::$userinfo['userid'] && can_perform('canputattach', $bug['productid'])));
+ $attachment['date'] = $datef->format(bugdar::$options['dateformat'], $attachment['dateline']);
$attachment['user'] = construct_user_display($attachment, false);
- eval('$attachments .= "' . $template->fetch('showreport_attachment') . '";');
+
+ $tpl = new BSTemplate('showreport_attachment');
+ $tpl->vars = array(
+ 'attachment' => $attachment
+ );
+ $attachments .= $tpl->evaluate()->getTemplate();
}
- $show['attachments'] = (!$show['putattachments'] AND !$attaches) ? false : true;
+ $show['attachments'] = ($show['putattachments'] && $attaches);
}
// -------------------------------------------------------------------
// votes
-$vote = $db->query_first("SELECT *, FIND_IN_SET(" . $bugsys->userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]");
+$vote = $db->queryFirst("SELECT *, FIND_IN_SET(" . bugdar::$userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]");
$vote['total'] = $vote['votefor'] + $vote['voteagainst'];
if ($vote['total'] != 0)
AND !hidden" : '') . "
ORDER BY comment.dateline ASC"
);
-while ($comment = $db->fetch_array($comments_fetch))
+foreach ($comments_fetch as $comment)
{
- $comment['posttime'] = $datef->format($bugsys->options['dateformat'], $comment['dateline']);
+ $comment['posttime'] = $datef->format(bugdar::$options['dateformat'], $comment['dateline']);
$comment['postby'] = construct_user_display($comment);
- $show['editcomment'] = ((can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid']));
+ $show['editcomment'] = ((can_perform('caneditownreply', $bug['productid']) AND bugdar::$userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['productid']) AND bugdar::$userinfo['userid'] != $comment['userid']));
- $bugsys->debug('can edit own replies: ' . (int)(can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']));
- $bugsys->debug('can edit other replies:' . (int)(can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid']));
- $bugsys->debug('$show[editcomment]: ' . $show['editcomment']);
+ BSApp::debug('can edit own replies: ' . (int)(can_perform('caneditownreply', $bug['productid']) AND bugdar::$userinfo['userid'] == $comment['userid']));
+ BSApp::debug('can edit other replies:' . (int)(can_perform('caneditotherreply', $bug['productid']) AND bugdar::$userinfo['userid'] != $comment['userid']));
+ BSApp::debug('$show[editcomment]: ' . $show['editcomment']);
if (is_array($hilight))
{
}
}
- eval('$comments .= "' . $template->fetch('showreport_comment') . '";');
+ $tpl = new BSTemplate('showreport_comment');
+ $tpl->vars = array('comment' => $comment);
+ $comments .= $tpl->evaluate()->getTemplate();
}
$show['newreply'] = (can_perform('canpostcomments', $bug['productid']) ? true : false);
}
}
-eval('$template->flush("' . $template->fetch('showreport') . '");');
+$tpl = new BSTemplate('showreport');
+$tpl->vars = array(
+ 'bug' => $bug,
+ 'comments' => $comments,
+ 'select' => $select,
+ 'vote' => $vote,
+ 'favoritetext' => $favoritetext,
+ 'customfields' => $customfields,
+ 'attachments' => $attachments,
+ 'productSelect' => $productSelect
+);
+$tpl->evaluate()->flush();
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
WHERE bug.product IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ")
AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . ")))
ORDER BY " . (can_perform('canviewhidden', 0, fetch_guest_user()) ? "bug.lastposttime" : "bug.hiddenlastposttime") . " DESC
- LIMIT " . $bugsys->options['syndicateditems']
+ LIMIT " . bugdar::$options['syndicateditems']
);
-while ($bug = $db->fetch_array($bugs_fetch))
+foreach ($bugs_fetch as $bug)
{
$syndicate .= '
<entry>
</tr>
<tr>
<td><strong>' . T('Product/Component/Version') . ':</strong></td>
- <td>' . $bugsys->datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? $bugsys->datastore['product']["$bug[component]"]['title'] . '/' : '') . $bugsys->datastore['version']["$bug[version]"]['version'] . '</td>
+ <td>' . bugdar::$datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? bugdar::$datastore['product']["$bug[component]"]['title'] . '/' : '') . bugdar::$datastore['version']["$bug[version]"]['version'] . '</td>
</tr>
<tr>
<td><strong>' . T('Status') . ':</strong></td>
- <td>' . $bugsys->datastore['status']["$bug[status]"]['status'] . '</td>
+ <td>' . bugdar::$datastore['status']["$bug[status]"]['status'] . '</td>
</tr>
<tr>
<td><strong>' . T('Severity') . ':</strong></td>
- <td>' . $bugsys->datastore['severity']["$bug[severity]"]['severity'] . '</td>
+ <td>' . bugdar::$datastore['severity']["$bug[severity]"]['severity'] . '</td>
</table>
<p>' . $bug['comment_parsed'] . '</p>') . '
</content>
<summary type="text">' . htmlspecialchars($bug['comment_parsed']) . '</summary>
- <link rel="alternate" href="' . $bugsys->options['trackerurl'] . '/showreport.php?bugid=' . $bug['bugid'] . '"/>
+ <link rel="alternate" href="' . bugdar::$options['trackerurl'] . '/showreport.php?bugid=' . $bug['bugid'] . '"/>
</entry>';
$lastupdated = $bug["$timestamp"];
echo '<?xml version="1.0" encoding="' . $language['charset'] . '"?>
<feed xmlns="http://www.w3.org/2005/Atom">
- <title>' . sprintf(T('%1$s Syndication Feed'), $bugsys->options['trackertitle']) . '</title>
- <link href="' . $bugsys->options['trackerurl'] . '"/>
+ <title>' . sprintf(T('%1$s Syndication Feed'), bugdar::$options['trackertitle']) . '</title>
+ <link href="' . bugdar::$options['trackerurl'] . '"/>
<updated>' . gmdate('Y-m-d\TH:i:s\Z', $lastupdated) . '</updated>
<!-- entries -->
</feed>';
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
- <!-- custom field$field[fieldid] -->
+ <!-- custom field<%- $field['fieldid'] %> -->
<fieldset>
- <legend>$field[name] $help[field$field[fieldid]]</legend>
- <div class="field"><if condition="$searchMode"><select name="custom$field[fieldid]"><option value="0">{@"Ignore"}</option><option value="1">{@"Yes"}</option><option value="-1">{@"No"}</option></select><else /><input name="custom$field[fieldid]" type="checkbox" value="1"$selected /></if></div>
+ <legend><%- $field['name'] %> help[field<%- $field['fieldid'] %>]</legend>
+ <div class="field"><% if ($searchMode): %><select name="custom<%- $field['fieldid'] %>"><option value="0"><%-T("Ignore")%></option><option value="1"><%-T("Yes")%></option><option value="-1"><%-T("No")%></option></select><% else: %><input name="custom<%- $field['fieldid'] %>" type="checkbox" value="1"<%- $selected %> /><% endif %></div>
</fieldset>
- <!-- / custom field$field[fieldid] -->
\ No newline at end of file
+ <!-- / custom field<%- $field['fieldid'] %> -->
\ No newline at end of file
- <!-- custom field$field[fieldid] -->
+ <!-- custom field<%- $field['fieldid'] %> -->
<fieldset>
- <legend>$field[name] $help[field$field[fieldid]]</legend>
- <div class="field"><input name="custom$field[fieldid]" type="text" value="$value" size="35"<if condition="$field['maxlength']"> maxlength="$field[maxlength]"</if> /></div>
+ <legend><%- $field['name'] %> help[field<%- $field['fieldid'] %>]</legend>
+ <div class="field"><input name="custom<%- $field['fieldid'] %>" type="text" value="<%- $value %>" size="35"<% if ($field['maxlength']): %> maxlength="<%- $field['maxlength'] %>"<% endif %> /></div>
</fieldset>
- <!-- / custom field$field[fieldid] -->
+ <!-- / custom field<%- $field['fieldid'] %> -->
- <!-- custom field$field[fieldid] -->
+ <!-- custom field<%- $field['fieldid'] %> -->
<fieldset>
- <legend>$field[name] $help[field$field[fieldid]]</legend>
- <div class="field"><select name="custom$field[fieldid]">$options</select></div>
+ <legend><%- $field['name'] %> <%- $help['field' . $field['fieldid']] %></legend>
+ <div class="field"><select name="custom<%- $field['fieldid'] %>"><%- $options %></select></div>
</fieldset>
- <!-- / custom field$field[fieldid] -->
\ No newline at end of file
+ <!-- / custom field<%- $field['fieldid'] %> -->
\ No newline at end of file
- <!-- custom field$field[fieldid] -->
+ <!-- custom field<%- $field['fieldid'] %> -->
<fieldset>
- <legend>$field[name] $help[field$field[fieldid]]</legend>
- <div class="field">$field[value]</div>
+ <legend><%- $field['name'] %> help[field<%- $field['fieldid'] %>]</legend>
+ <div class="field"><%- $field['value'] %></div>
</fieldset>
- <!-- / custom field$field[fieldid] -->
+ <!-- / custom field<%- $field['fieldid'] %> -->
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title>$attachment[filename] - $bug[summary]</title>
+ <title><%- $attachment['filename'] %> - <%- $bug['summary'] %></title>
</head>
<body>
-$header
+<%- $header %>
<form action="attachment.php" method="post" enctype="multipart/form-data" name="newattach">
<input name="do" type="hidden" value="update" />
-<input name="attachmentid" type="hidden" value="$attachment[attachmentid]" />
+<input name="attachmentid" type="hidden" value="<%- $attachment['attachmentid'] %>" />
<div class="box">
- <div class="box-head" style="text-align: $stylevar[left]">
- <lang 1="$attachment[attachmentid]" 2="$bug[bugid]" 3="$bug[summary]">{@"Attachment #%1$s for Bug #%2$s %3$s"}</lang>
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>">
+ <%- sprintf(T('Attachment #%1$s for Bug #%2$s %3$s'), $attachment['attachmentid'], $bug['bugid'], $bug['summary']) %>
</div>
- <div class="box-mid box-margmod-bottom" style="text-align: $stylevar[left]">
- <div><strong>{@"Attachment"}:</strong> <a href="viewattachment.php?attachmentid=$attachment[attachmentid]">{@"View"}</a> [$attachment[filename]]</div>
+ <div class="box-mid box-margmod-bottom" style="text-align: <%- $stylevar['left'] %>">
+ <div><strong><%-T("Attachment")%>:</strong> <a href="viewattachment.php?attachmentid=<%- $attachment['attachmentid'] %>"><%-T("View")%></a> [<%- $attachment['filename'] %>]</div>
</div>
- <div class="box-mid" style="text-align: $stylevar[left]">
- <div><strong>{@"Description"}:</strong> <input name="description" type="text" size="35" maxlength="250" value="$attachment[description]" /></div>
- <div><strong>{@"Obsolete"}:</strong> <input name="obsolete" type="checkbox" value="1"<if condition="$attachment['obsolete']"> checked="checked"</if> /></div>
+ <div class="box-mid" style="text-align: <%- $stylevar['left'] %>">
+ <div><strong><%-T("Description")%>:</strong> <input name="description" type="text" size="35" maxlength="250" value="<%- $attachment['description'] %>" /></div>
+ <div><strong><%-T("Obsolete")%>:</strong> <input name="obsolete" type="checkbox" value="1"<% if ($attachment['obsolete']): %> checked="checked"<% endif %> /></div>
</div>
</div>
<br />
<div id="submitrow">
- <input name="submit" type="submit" value=" {@"Submit"} " accesskey="s" />
- <if condition="$show['delete']"><input name="__delete__" type="submit" value=" {@"Delete"} " /></if>
- <input name="reset" type="reset" value=" {@"Reset"} " accesskey="r" />
- <script type="text/javascript"> draw_cancel("showreport.php?bugid=$bug[bugid]"); </script>
+ <input name="submit" type="submit" value=" <%-T("Submit")%> " accesskey="s" />
+ <% if ($show['delete']): %><input name="__delete__" type="submit" value=" <%-T("Delete")%> " /><% endif %>
+ <input name="reset" type="reset" value=" <%-T("Reset")%> " accesskey="r" />
+ <script type="text/javascript"> draw_cancel("showreport.php?bugid=<%- $bug['bugid'] %>"); </script>
</div>
</form>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title><lang 1="$comment[commentid]">{@"Edit Comment %1$s"}</lang> - $bug[summary]</title>
+ <title><%- sprintf(T('Edit Comment %1$s'), $comment['commentid']) %> - <%- $bug['summary'] %></title>
</head>
<body>
-$header
+<%- $header %>
-<if condition="$show['errors']">
-<div class="error" style="text-align: $stylevar[left]">
- {@"The following errors occurred"}:
- {$message->errorBox}
+<% if ($show['errors']): %>
+<div class="error" style="text-align: <%- $stylevar['left'] %>">
+ <%-T("The following errors occurred")%>:
+ <%- $message->errorBox %>
</div>
-</if>
+<% endif %>
<form name="editcomment" method="post" action="editcomment.php">
<input type="hidden" name="do" value="update" />
-<input type="hidden" name="commentid" value="$comment[commentid]" />
+<input type="hidden" name="commentid" value="<%- $comment['commentid'] %>" />
<div class="box">
- <div class="box-head" style="text-align: $stylevar[left]">
- <lang 1="$comment[commentid]" 2="$bug[bugid]" 3="$bug[summary]">{@"Comment #%1$s in bug #%2$s <em>%3$s</em>"}</lang>
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>">
+ <%- sprintf(T('Comment #%1$s in bug #%2$s <em>%3$s</em>'), $comment['commentid'], $bug['bugid'], $bug['summary']) %>
</div>
- <div class="box-foot box-margmod-bottom" style="text-align: $stylevar[left]"><lang 1="$comment[posttime]" 2="$comment[postby]">{@"Posted on %1$s by %2$s"}</lang></div>
+ <div class="box-foot box-margmod-bottom" style="text-align: <%- $stylevar['left'] %>"><%- sprintf(T('Posted on %1$s by %2$s'), $comment['posttime'], $comment['postby']) %></div>
- <div class="box-mid" style="text-align: $stylevar[left]">
- <if condition="$show['hide']"><div><strong<if condition="$comment['hidden']"> style="color: red"</if>>{@"Hidden"}:</strong> <input type="checkbox" name="hidden" value="1"<if condition="$comment['hidden']"> checked="checked"</if> /></div></if>
- <div><strong>{@"Parse Links in the Comment"}:</strong> <input type="checkbox" name="parselinks" value="1"<if condition="$comment['parselinks']"> checked="checked"</if> /></div>
- <textarea name="comment" cols="50" rows="15" class="textarea">$comment[comment]</textarea>
+ <div class="box-mid" style="text-align: <%- $stylevar['left'] %>">
+ <% if ($show['hide']): %><div><strong<% if ($comment['hidden']): %> style="color: red"<% endif %>><%-T("Hidden")%>:</strong> <input type="checkbox" name="hidden" value="1"<% if ($comment['hidden']): %> checked="checked"<% endif %> /></div><% endif %>
+ <div><strong><%-T("Parse Links in the Comment")%>:</strong> <input type="checkbox" name="parselinks" value="1"<% if ($comment['parselinks']): %> checked="checked"<% endif %> /></div>
+ <textarea name="comment" cols="50" rows="15" class="textarea"><%- $comment['comment'] %></textarea>
</div>
</div>
<br />
<div id="submitrow">
- <input type="submit" name="submit" accesskey="s" value=" {@"Save Changes"} " />
- <input type="reset" name="reset" accesskey="r" value=" {@"Reset Fields"} " />
- <script type="text/javascript"> draw_cancel("showreport.php?bugid=$bug[bugid]"); </script>
+ <input type="submit" name="submit" accesskey="s" value=" <%-T("Save Changes")%> " />
+ <input type="reset" name="reset" accesskey="r" value=" <%-T("Reset Fields")%> " />
+ <script type="text/javascript"> draw_cancel("showreport.php?bugid=<%- $bug['bugid'] %>"); </script>
</div>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
- <title>{$bugsys->options['trackertitle']} - {@"Automations"}</title>
+<%- $headinclude %>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Automations")%></title>
</head>
<body>
-$header
+<%- $header %>
-<h2>{@"Explication of Automations"}</h2>
+<h2><%-T("Explication of Automations")%></h2>
<table class="table">
-$automations
+<%- $automations %>
</table>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
- <title>{$bugsys->options['trackertitle']} - {@"Products"}</title>
+<%- $headinclude %>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Products")%></title>
</head>
<body>
-$header
+<%- $header %>
-<h2>{@"Explication of Products"}</h2>
+<h2><%-T("Explication of Products")%></h2>
-<if condition="$globalversions">
+<% if ($globalversions): %>
<table class="table">
<tr class="listinghead">
- <td colspan="2">{@"Global Versions"}</td>
+ <td colspan="2"><%-T("Global Versions")%></td>
</tr>
<tr class="altcolor">
- <td colspan="2">{@"These versions are avaliable for every product, component, and version."}</td>
+ <td colspan="2"><%-T("These versions are avaliable for every product, component, and version.")%></td>
</tr>
- $globalversions
+ <%- $globalversions %>
</table>
-</if>
+<% endif %>
<br />
<table class="table">
<tr class="listinghead">
- <td colspan="2">{@"Products (components are in white)"}</td>
+ <td colspan="2"><%-T("Products (components are in white)")%></td>
</tr>
-$productlist
+<%- $productlist %>
</table>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-<tr$trextra>
- <td width="50%">$left</td>
- <td>$right</td>
+<tr<%- $trextra %>>
+ <td width="50%"><%- $left %></td>
+ <td><%- $right %></td>
</tr>
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
- <title>{$bugsys->options['trackertitle']} - {@"My Favorite Bugs"}</title>
+<%- $headinclude %>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("My Favorite Bugs")%></title>
</head>
<body>
-$header
+<%- $header %>
<table class="table">
<tr class="listinghead">
-$headers
+<%- $headers %>
</tr>
-$bugs
+<%- $bugs %>
</table>
-<if condition="$show['pagenav']">
+<% if ($show['pagenav']): %>
<!-- pagenav -->
<div align="right">
-$pagenav
+<%- $pagenav %>
</div>
<!-- / pagenav -->
-</if>
+<% endif %>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
</div>
<div id="copyright">
- <div>{@"Powered by Bugdar"}, {@"Copyright"} ©2002 - $year Blue Static</div>
+ <div><%-T("Powered by Bugdar")%>, <%-T("Copyright")%> ©2002 - <%- date('Y') %> Blue Static</div>
</div>
</body>
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
<div id="header">
<!-- quick search -->
- <form name="quicksearch" action="showreport.php" method="post" id="quicksearch" style="float: $stylevar[right]">
+ <form name="quicksearch" action="showreport.php" method="post" id="quicksearch" style="float: <%- $stylevar['right'] %>">
<input type="hidden" name="do" value="quicksearch" />
- {@"Go to bug ID"} <input type="text" name="bugid" size="5" /> <input type="submit" name="submit" value=" {@"Go"} " />
+ <%-T("Go to bug ID")%> <input type="text" name="bugid" size="5" /> <input type="submit" name="submit" value=" <%-T("Go")%> " />
</form>
<!-- / quick search -->
- <span id="title"><a href="index.php">{$bugsys->options['trackertitle']}</a></span>
+ <span id="title"><a href="index.php"><%- bugdar::$options['trackertitle'] %></a></span>
- <img src="templates/images/clock.gif" alt="{@"Current Date and Time"}" />
- <span id="time">$datetime</span>
+ <img src="templates/images/clock.gif" alt="<%-T("Current Date and Time")%>" />
+ <span id="time"><%- BSApp::$date->format('l, F j, Y g:i A') %></span>
</div>
-<if condition="!$bugsys->userinfo['userid']">
+<% if (!bugdar::$userinfo['userid']): %>
<div class="alertbox">
- {@"Hello, guest. We have noticed that you are not registered at this bug tracker. Your experience will be greatly enhanced if you log in. To do so, you first must register by clicking on the <a href="register.php">Register</a> tab at the top. If you are already registered, you can login at the <a href="login.php">Login</a> tab."}
+ <%-T('Hello, guest. We have noticed that you are not registered at this bug tracker. Your experience will be greatly enhanced if you log in. To do so, you first must register by clicking on the <a href="register.php">Register</a> tab at the top. If you are already registered, you can login at the <a href="login.php">Login</a> tab.')%>
</div>
-</if>
+<% endif %>
<div id="tabbar">
- <span style="float: $stylevar[right]" class="smallfont"><a href="syndicate.php"><img src="templates/images/feed.gif" alt="{@"Syndicate"}" style="border: 0px" /> {@"Syndicate"}</a></span>
+ <span style="float: <%- $stylevar['right'] %>" class="smallfont"><a href="syndicate.php"><img src="templates/images/feed.gif" alt="<%-T("Syndicate")%>" style="border: 0px" /> <%-T("Syndicate")%></a></span>
- <a class="tab$focus[index]" href="index.php">{@"Listing"}</a>
- <if condition="$show['newreport']">
- <a class="tab$focus[newreport]" href="newreport.php">{@"New"}</a>
- </if>
- <a class="tab$focus[showreport]" href="showreport.php">{@"Display"}</a>
- <if condition="$show['search']">
- <a class="tab$focus[search]" href="search.php">{@"Search"}</a>
- </if>
- <if condition="$bugsys->userinfo['userid']">
- <a class="tab$focus[favorites]" href="favorite.php">{@"Favorites"}</a>
- </if>
- <a class="tab$focus[user]" href="<if condition="$bugsys->userinfo['userid']">userctrl.php">{@"Options"}<else />login.php">{@"Login/Register"}</if></a>
- <if condition="$show['admin']">
- <a class="tab" href="admin/index.php">{@"Administration"}</a>
- </if>
- <if condition="$bugsys->userinfo['userid']">
- <a class="tab$focus[logout]" href="login.php?do=logout" onclick="return confirm('{@"Are you sure you want to log out?"}')">{@"Logout"}</a>
- </if>
+ <a class="tab<%- $focus['index'] %>" href="index.php"><%-T("Listing")%></a>
+ <% if ($show['newreport']): %>
+ <a class="tab<%- $focus['newreport'] %>" href="newreport.php"><%-T("New")%></a>
+ <% endif %>
+ <a class="tab<%- $focus['showreport'] %>" href="showreport.php"><%-T("Display")%></a>
+ <% if ($show['search']): %>
+ <a class="tab<%- $focus['search'] %>" href="search.php"><%-T("Search")%></a>
+ <% endif %>
+ <% if (bugdar::$userinfo['userid']): %>
+ <a class="tab<%- $focus['favorites'] %>" href="favorite.php"><%-T("Favorites")%></a>
+ <% endif %>
+ <a class="tab<%- $focus['user'] %>" href="<% if (bugdar::$userinfo['userid']): %>userctrl.php"><%-T("Options")%><% else: %>login.php"><%-T("Login/Register")%><% endif %></a>
+ <% if ($show['admin']): %>
+ <a class="tab" href="admin/index.php"><%-T("Administration")%></a>
+ <% endif %>
+ <% if (bugdar::$userinfo['userid']): %>
+ <a class="tab<%- $focus['logout'] %>" href="login.php?do=logout" onclick="return confirm('<%-T("Are you sure you want to log out?")%>')"><%-T("Logout")%></a>
+ <% endif %>
</div>
<div id="content">
\ No newline at end of file
<!-- CSS and JavaScript goes here -->
- <meta http-equiv="Content-Type" content="text/html; charset=$stylevar[charset]" />
+ <meta http-equiv="Content-Type" content="text/html; charset=<%- $stylevar[charset] %>" />
<link rel="stylesheet" type="text/css" href="templates/global.css" media="screen" />
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="syndicate.php" />
- <script type="text/javascript"> var lang = { "Cancel" : "{@"Cancel"}" }; </script>
+ <script type="text/javascript"> var lang = { "Cancel" : "<%-T("Cancel")%>" }; </script>
<script src="templates/global.js" type="text/javascript"></script>
\ No newline at end of file
-<a href="#" onclick="window.open('help.php?topic=$topic', 'helpwindow', 'menubar=no,toolbar=no,status=no,height=300,width=275')" title="{@"Help"}"><img src="templates/images/question-mark.gif" alt="?" class="helplink" /></a>
\ No newline at end of file
+<a href="#" onclick="window.open('help.php?topic=<%- $topic %>', 'helpwindow', 'menubar=no,toolbar=no,status=no,height=300,width=275')" title="<%-T("Help")%>"><img src="templates/images/question-mark.gif" alt="?" class="helplink" /></a>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title>{@"Help"} - $topic[title]</title>
+ <title><%-T("Help")%> - <%- $topic['title'] %></title>
</head>
<body>
<div align="center" style="margin-top: 10px">
<div class="box" style="width: 90%">
- <div class="box-head">{@"Help"} : $topic[title]</div>
+ <div class="box-head"><%-T("Help")%> : <%- $topic['title'] %></div>
<div class="box-mid box-overpad">
- $topic[body]
+ <%- $topic['body'] %>
</div>
</div>
</div>
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
- <title>{@"Bug History"} - $bug[summary]</title>
+<%- $headinclude %>
+ <title><%-T("Bug History")%> - <%- $bug['summary'] %></title>
</head>
<body>
-$header
+<%- $header %>
-<h2><lang 1="$bug[summary]" 2="$bug[bugid]">{@"History for <a href="showreport.php?bugid=%2$d"><em>%1$s</em></a> (bugid: %2$s)"}</lang></h2>
+<h2><%- sprintf(T('History for <a href="showreport.php?bugid=%2$d"><em>%1$s</em></a> (bugid: %2$s)'), $bug['summary'], $bug['bugid']) %></h2>
<table class="table">
<tr class="listinghead">
- <td>{@"User"}</td>
- <td>{@"Date"}</td>
- <td>{@"Field"}</td>
- <td>{@"Old Value"}</td>
- <td>{@"New Value"}</td>
+ <td><%-T("User")%></td>
+ <td><%-T("Date")%></td>
+ <td><%-T("Field")%></td>
+ <td><%-T("Old Value")%></td>
+ <td><%-T("New Value")%></td>
</tr>
-$history
+<%- $history %>
</table>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-<tr style="vertical-align: top"<if condition="$bgcolor"> class="$bgcolor"</if>>
- <td width="10%"><if condition="$show['group']">$log[user]<else /> </if></td>
- <td width="20%"><if condition="$show['group']">$log[date]<else /> </if></td>
- <td width="20%">$log[field]</td>
- <td width="25%">$log[original]</td>
- <td width="25%">$log[changed]</td>
+<tr style="vertical-align: top"<% if ($bgcolor): %> class="<%- $bgcolor %>"<% endif %>>
+ <td width="10%"><% if ($show['group']): %><%- $log['user'] %><% else: %> <% endif %></td>
+ <td width="20%"><% if ($show['group']): %><%- $log['date'] %><% else: %> <% endif %></td>
+ <td width="20%"><%- $log['field'] %></td>
+ <td width="25%"><%- $log['original'] %></td>
+ <td width="25%"><%- $log['changed'] %></td>
</tr>
- <td>$name $image</td>
+ <td><%- $name %> <%- $image %></td>
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title>{$bugsys->options['trackertitle']} - {@"Login"}</title>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Login")%></title>
</head>
<body>
-$header
+<%- $header %>
<form action="login.php" name="register" method="post">
<input type="hidden" name="do" value="login" />
<div align="center" style="margin-top: 10px">
<div class="box altwidth">
- <div class="box-head">{@"Login"}</div>
+ <div class="box-head"><%-T("Login")%></div>
<div class="box-mid">
- <div><strong>{@"Email"}:</strong> <input type="text" name="email" size="30" /></div>
- <div><strong>{@"Password"}:</strong> <input type="password" name="password" size="30" /></div>
- <div><strong>{@"Remember Me"}:</strong> <input type="checkbox" name="rememberme" value="1" /> {@"Yes"}</div>
+ <div><strong><%-T("Email")%>:</strong> <input type="text" name="email" size="30" /></div>
+ <div><strong><%-T("Password")%>:</strong> <input type="password" name="password" size="30" /></div>
+ <div><strong><%-T("Remember Me")%>:</strong> <input type="checkbox" name="rememberme" value="1" /> <%-T("Yes")%></div>
<br />
- [<a href="register.php">{@"Register"}</a>] [<a href="login.php?do=lostpw">{@"Lost Password"}</a>]
+ [<a href="register.php"><%-T("Register")%></a>] [<a href="login.php?do=lostpw"><%-T("Lost Password")%></a>]
</div>
<div class="box-foot box-center">
- <input type="submit" name="submit" value=" {@"Login"} " accesskey="s" />
- <input type="reset" name="reset" value=" {@"Reset"} " accesskey="r" />
+ <input type="submit" name="submit" value=" <%-T("Login")%> " accesskey="s" />
+ <input type="reset" name="reset" value=" <%-T("Reset")%> " accesskey="r" />
</div>
</div>
</div>
</form>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title>{$bugsys->options['trackertitle']} - {@"Lost Password"}</title>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Lost Password")%></title>
</head>
<body>
-$header
+<%- $header %>
<form action="login.php" name="lostpw" method="post">
<input type="hidden" name="do" value="sendpw" />
<div align="center" style="margin-top: 10px">
<div class="box altwidth">
- <div class="box-head">{@"Lost Password Recovery"}</div>
+ <div class="box-head"><%-T("Lost Password Recovery")%></div>
<div class="box-mid">
- <if condition="$show['lostpwerror']"><div class="error">{@"The specified email could not be found or it is invalid."}</div></if>
- <div>{@"Enter your email in the box below and you will receive a message with instructions on how to set a new password."}</div>
- <div><strong>{@"Email"}:</strong> <input type="text" name="email" size="30" value="{$bugsys->in['email']}" /></div>
+ <% if ($show['lostpwerror']): %><div class="error"><%-T("The specified email could not be found or it is invalid.")%></div><% endif %>
+ <div><%-T("Enter your email in the box below and you will receive a message with instructions on how to set a new password.")%></div>
+ <div><strong><%-T("Email")%>:</strong> <input type="text" name="email" size="30" value="<%- $input->in['email'] %>" /></div>
</div>
<div class="box-foot box-center">
- <input type="submit" name="submit" value=" {@"Submit"} " accesskey="s" />
- <input type="reset" name="reset" value=" {@"Reset"} " accesskey="r" />
+ <input type="submit" name="submit" value=" <%-T("Submit")%> " accesskey="s" />
+ <input type="reset" name="reset" value=" <%-T("Reset")%> " accesskey="r" />
</div>
</div>
</div>
</form>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title>{@"New Attachment"} - $bug[summary]</title>
+ <title><%-T("New Attachment")%> - <%- $bug['summary'] %></title>
</head>
<body>
-$header
+<%- $header %>
-<if condition="$show['errors']">
-<div class="error" style="text-align: $stylevar[left]">
- {@"The following errors occurred"}:
- {$message->errorBox}
+<% if ($show['errors']): %>
+<div class="error" style="text-align: <%- $stylevar['left'] %>">
+ <%-T("The following errors occurred")%>:
+ <%- $message->errorBox %>
</div>
-</if>
+<% endif %>
<form action="attachment.php" method="post" enctype="multipart/form-data" name="newattach">
<input name="do" type="hidden" value="insert" />
-<input name="bugid" type="hidden" value="$bug[bugid]" />
-<input name="MAX_FILE_SIZE" type="hidden" value="$MAXFILESIZE" />
+<input name="bugid" type="hidden" value="<%- $bug['bugid'] %>" />
+<input name="MAX_FILE_SIZE" type="hidden" value="<%- $MAXFILESIZE %>" />
<div class="box">
- <div class="box-head" style="text-align: $stylevar[left]"><lang 1="$bug[bugid]" 2="$bug[summary]">{@"New Attachment for Bug #%1$s %2$s"}</lang></div>
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>"><%- sprintf(T('New Attachment for Bug #%1$s %2$s'), $bug['bugid'], $bug['summary']) %></div>
- <div class="box-mid box-margmod-bottom" style="text-align: $stylevar[left]">
+ <div class="box-mid box-margmod-bottom" style="text-align: <%- $stylevar['left'] %>">
<div><input name="attachment" type="file" /></div>
- <div><strong>{@"Description"}:</strong> <input name="description" type="text" size="35" value="{$bugsys->in['description']}" maxlength="250" /></div>
+ <div><strong><%-T("Description")%>:</strong> <input name="description" type="text" size="35" value="<%- $input->in['description'] %>" maxlength="250" /></div>
</div>
- <if condition="$show['obsoletes']">
- <div class="box-mid box-margmod-bottom" style="text-align: $stylevar[left]">
- <div><strong>{@"Mark the Following Attachments Obsolete"}:</strong>
- $obsoletes
+ <% if ($show['obsoletes']): %>
+ <div class="box-mid box-margmod-bottom" style="text-align: <%- $stylevar['left'] %>">
+ <div><strong><%-T("Mark the Following Attachments Obsolete")%>:</strong>
+ <%- $obsoletes %>
</div>
</div>
- </if>
+ <% endif %>
- <if condition="$show['addcomment']">
- <div class="box-mid" style="text-align: $stylevar[left]">
- <div><strong>{@"Add Comment"}:</strong>
+ <% if ($show['addcomment']): %>
+ <div class="box-mid" style="text-align: <%- $stylevar['left'] %>">
+ <div><strong><%-T("Add Comment")%>:</strong>
<div>
- <textarea name="comment" rows="10" cols="50" class="textarea">{$bugsys->in['comment']}</textarea>
+ <textarea name="comment" rows="10" cols="50" class="textarea"><%- $input->in['comment'] %></textarea>
</div>
</div>
</div>
- </if>
+ <% endif %>
</div>
<br />
<div id="submitrow">
- <input name="submit" type="submit" value=" {@"Submit"} " accesskey="s" />
- <input name="reset" type="reset" value=" {@"Reset"} " accesskey="r" />
- <script type="text/javascript"> draw_cancel("showreport.php?bugid=$bug[bugid]"); </script>
+ <input name="submit" type="submit" value=" <%-T("Submit")%> " accesskey="s" />
+ <input name="reset" type="reset" value=" <%-T("Reset")%> " accesskey="r" />
+ <script type="text/javascript"> draw_cancel("showreport.php?bugid=<%- $bug['bugid'] %>"); </script>
</div>
</form>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/report.css" media="screen" />
<link rel="stylesheet" type="text/css" href="templates/fields.css" media="screen" />
- <title>{@"New Bug Report"} - {$bugsys->options['trackertitle']}</title>
+ <title><%-T("New Bug Report")%> - <%- bugdar::$options['trackertitle'] %></title>
</head>
<body>
-$header
+<%- $header %>
-<if condition="$show['errors']">
-<div class="error" style="text-align: $stylevar[left]">
- {@"The following errors occurred"}:
- {$message->errorBox}
+<% if ($show['errors']): %>
+<div class="error" style="text-align: <%- $stylevar['left'] %>">
+ <%-T("The following errors occurred")%>:
+ <%- $message->errorBox %>
</div>
-</if>
+<% endif %>
<form name="bugreport" action="newreport.php" method="post" class="form">
<input type="hidden" name="do" value="insert" />
<div id="fieldbody">
<!-- LEFT COLUMN -->
- <div id="$stylevar[left]col">
+ <div id="<%- $stylevar['left'] %>col">
<!-- summary -->
<fieldset>
- <legend>{@"Reporter"} $help[reporter]</legend>
- <div class="field">$reporter</div>
+ <legend><%-T("Reporter")%> $help[reporter]</legend>
+ <div class="field"><%- $reporter %></div>
</fieldset>
<!-- / summary -->
<!-- product -->
<fieldset>
- <legend><a href="explain.php?do=products">{@"Product/Version"}</a> $help[product]</legend>
- <div class="field"><select name="product"><if condition="!$bugsys->in['product']"><option value="0" selected="selected">{@"Select..."}</option></if>$productSelect</select></div>
+ <legend><a href="explain.php?do=products"><%-T("Product/Version")%></a> $help[product]</legend>
+ <div class="field"><select name="product"><% if (!$input->in['product']): %><option value="0" selected="selected"><%-T("Select...")%></option><% endif %><%- $productSelect %></select></div>
</fieldset>
<!-- / product -->
- <if condition="$show['changestatus']">
+ <% if ($show['changestatus']): %>
<!-- status -->
<fieldset>
- <legend>{@"Status"} $help[status]</legend>
- <div class="field"><select name="status">$select[status]</select></div>
+ <legend><%-T("Status")%> $help[status]</legend>
+ <div class="field"><select name="status"><%- $select['status'] %></select></div>
</fieldset>
<!-- / status -->
- </if>
+ <% endif %>
<!-- severity -->
<fieldset>
- <legend>{@"Severity"} $help[severity]</legend>
- <div class="field"><select name="severity">$select[severity]</select></div>
+ <legend><%-T("Severity")%> $help[severity]</legend>
+ <div class="field"><select name="severity"><%- $select['severity'] %></select></div>
</fieldset>
<!-- / severity -->
- $customfields[left]
+ <%- $customfields['left'] %>
</div>
<!-- / LEFT COLUMN -->
<!-- RIGHT COLUMN -->
- <div id="$stylevar[right]col">
+ <div id="<%- $stylevar['right'] %>col">
<!-- summary -->
<fieldset>
- <legend>{@"Summary"} $help[summary]</legend>
- <div class="field"><input type="text" name="summary" size="25" value="{$bugsys->in['summary']}" style="width: 100%" maxlength="250" /></div>
+ <legend><%-T("Summary")%> $help[summary]</legend>
+ <div class="field"><input type="text" name="summary" size="25" value="<%- $input->in['summary'] %>" style="width: 100%" maxlength="250" /></div>
</fieldset>
<!-- / summary -->
- <if condition="$show['assign']">
+ <% if ($show['assign']): %>
<!-- assignment -->
<fieldset>
- <legend>{@"Assignment"} $help[assignedto]</legend>
- <div class="field"><select name="assignedto"><option value="0" selected="selected">{@"No Assignment"}</option>$select[dev]</select></div>
+ <legend><%-T("Assignment")%> $help[assignedto]</legend>
+ <div class="field"><select name="assignedto"><option value="0" selected="selected"><%-T("No Assignment")%></option><%- $select['dev'] %></select></div>
</fieldset>
<!-- / assignment -->
- </if>
+ <% endif %>
- <if condition="$show['changestatus']">
+ <% if ($show['changestatus']): %>
<!-- resolution -->
<fieldset>
- <legend>{@"Resolution"} $help[resolution]</legend>
- <div class="field"><select name="resolution">$select[resolution]</select></div>
+ <legend><%-T("Resolution")%> $help[resolution]</legend>
+ <div class="field"><select name="resolution"><%- $select['resolution'] %></select></div>
</fieldset>
<!-- / resolution -->
- </if>
+ <% endif %>
- <if condition="$show['changestatus']">
+ <% if ($show['changestatus']): %>
<!-- priority -->
<fieldset>
- <legend>{@"Priority"} $help[priority]</legend>
- <div class="field"><select name="priority">$select[priority]</select></div>
+ <legend><%-T("Priority")%> $help[priority]</legend>
+ <div class="field"><select name="priority"><%- $select['priority'] %></select></div>
</fieldset>
<!-- / priority -->
- </if>
+ <% endif %>
- $customfields[right]
+ <%- $customfields['right'] %>
</div>
<!-- / RIGHT COLUMN -->
<!-- new reply -->
<div style="width: 100%">
<fieldset>
- <legend>{@"Description/Initial Report"}</legend>
+ <legend><%-T("Description/Initial Report")%></legend>
- <textarea name="comment" cols="50" rows="10" class="textarea"><if condition="$bugsys->in['comment']">{$bugsys->in['comment']}<else />{$bugsys->options['defaultcomment']}</if></textarea>
+ <textarea name="comment" cols="50" rows="10" class="textarea"><% if ($input->in['comment']): %><%- $input->in['comment'] %><% else: %><%- bugdar::$options['defaultcomment'] %><% endif %></textarea>
- <div><input type="checkbox" name="parselinks" value="1"<if condition="$bugsys->in['parselinks']"> checked="checked"</if> /> {@"Parse Links in the Comment"}</div>
+ <div><input type="checkbox" name="parselinks" value="1"<% if ($input->in['parselinks']): %> checked="checked"<% endif %> /> <%-T("Parse Links in the Comment")%></div>
</fieldset>
</div>
<!-- / new reply -->
<!-- submit row -->
<div id="submitrow">
- <input type="submit" name="submit" value=" {@"Submit Report"} " accesskey="s" />
- <input type="reset" name="reset" value=" {@"Reset Fields"} " accesskey="r" />
- <input type="submit" name="submit_reload" value=" {@"Submit Report and Add Another Bug"} " accesskey="e" />
+ <input type="submit" name="submit" value=" <%-T("Submit Report")%> " accesskey="s" />
+ <input type="reset" name="reset" value=" <%-T("Reset Fields")%> " accesskey="r" />
+ <input type="submit" name="submit_reload" value=" <%-T("Submit Report and Add Another Bug")%> " accesskey="e" />
</div>
<!-- / submit row -->
</form>
-<!-- <script type="text/javascript"> setup_report("{$bugsys->in['product']}", "{$bugsys->in['component']}", "{$bugsys->in['version']}"); </script> -->
+<!-- <script type="text/javascript"> setup_report("{$input->in['product']}", "{$input->in['component']}", "{$input->in['version']}"); </script> -->
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
<div>
- <if condition="$show['first']"><a href="{$baselink}p=1&pp={$paginator->perpage}">{@"First"}</a> ...</if>
- <if condition="$show['prev']"><a href="{$baselink}p=$prevpage&pp={$paginator->perpage}">{@"Prev"}</a> ...</if>
-$pagebits
- <if condition="$show['next']">... <a href="{$baselink}p=$nextpage&pp={$paginator->perpage}">{@"Next"}</a></if>
- <if condition="$show['last']">... <a href="{$baselink}p={$paginator->pagecount}&pp={$paginator->perpage}">{@"Last"}</a></if>
+ <% if ($show['first']): %><a href="<%- $baselink %>&p=1&pp=<%- $paginator->perpage %>"><%-T("First")%></a> ...<% endif %>
+ <% if ($show['prev']): %><a href="<%- $baselink %>&p=<%- $prevpage %>&pp=<%- $paginator->perpage %>"><%-T("Prev")%></a> ...<% endif %>
+<%- $pagebits %>
+ <% if ($show['next']): %>... <a href="<%- $baselink %>&p=<%- $nextpage %>&pp=<%- $paginator->perpage %>"><%-T("Next")%></a><% endif %>
+ <% if ($show['last']): %>... <a href="<%- $baselink %>&p=<%- $paginator->pagecount %>&pp=<%- $paginator->perpage %>"><%-T("Last")%></a><% endif %>
</div>
\ No newline at end of file
- <if condition="$nolink"><strong>$number</strong><else /><a href="{$baselink}p=$number&pp={$paginator->perpage}">$number</a></if>
\ No newline at end of file
+ <% if ($nolink): %><strong><%- $number %></strong><% else: %><a href="<%- $baselink %>&p=<%- $number %>&pp=<%- $paginator->perpage %>"><%- $number %></a><% endif %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title>{$bugsys->options['trackertitle']} - {@"Reset Password"}</title>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Reset Password")%></title>
</head>
<body>
-$header
+<%- $header %>
<form action="login.php" name="resetpw" method="post">
<input type="hidden" name="do" value="resetpw" />
-<input type="hidden" name="activator" value="$activation[activatorid]" />
+<input type="hidden" name="activator" value="<%- $activation['activatorid'] %>" />
-<if condition="$show['errors']">
-<div class="error" style="text-align: $stylevar[left]">
- {@"The following errors occurred"}:
- {$message->errorBox}
+<% if ($show['errors']): %>
+<div class="error" style="text-align: <%- $stylevar['left'] %>">
+ <%-T("The following errors occurred")%>:
+ <%- $message->errorBox %>
</div>
-</if>
+<% endif %>
<div align="center" style="margin-top: 10px">
<div class="box altwidth">
- <div class="box-head">{@"Lost Password Recovery: Password Reset"}</div>
+ <div class="box-head"><%-T("Lost Password Recovery: Password Reset")%></div>
<div class="box-mid">
- <div>{@"Enter a new password below and then confirm it."}</div>
- <div><strong>{@"New Password"}:</strong> <input type="password" name="fix_password" size="30" /></div>
- <div><strong>{@"Confirm Password"}:</strong> <input type="password" name="confirm_password" size="30" /></div>
+ <div><%-T("Enter a new password below and then confirm it.")%></div>
+ <div><strong><%-T("New Password")%>:</strong> <input type="password" name="fix_password" size="30" /></div>
+ <div><strong><%-T("Confirm Password")%>:</strong> <input type="password" name="confirm_password" size="30" /></div>
</div>
<div class="box-foot box-center">
- <input type="submit" name="submit" value=" {@"Submit"} " accesskey="s" />
- <input type="reset" name="reset" value=" {@"Reset"} " accesskey="r" />
+ <input type="submit" name="submit" value=" <%-T("Submit")%> " accesskey="s" />
+ <input type="reset" name="reset" value=" <%-T("Reset")%> " accesskey="r" />
</div>
</div>
</div>
</form>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title>{$bugsys->options['trackertitle']} - {@"Quick Search"}</title>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Quick Search")%></title>
</head>
<body>
-$header
+<%- $header %>
<div align="center" style="margin-top: 10px">
<div class="box altwidth">
- <div class="box-head" style="text-align: $stylevar[left]">{@"Quick Search"}</div>
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>"><%-T("Quick Search")%></div>
- <div class="box-mid box-overpad" style="text-align: $stylevar[left]">
- <if condition="$error">
- <div class="error" style="margin-bottom: 5px; text-align: $stylevar[left]">$error</div>
- </if>
+ <div class="box-mid box-overpad" style="text-align: <%- $stylevar['left'] %>">
+ <% if ($error): %>
+ <div class="error" style="margin-bottom: 5px; text-align: <%- $stylevar['left'] %>"><%- $error %></div>
+ <% endif %>
<form name="quicksearch" action="showreport.php" method="post" class="form">
<input type="hidden" name="do" value="quicksearch" />
- {@"Go to bug ID"} <input type="text" name="bugid" size="5" /> <input type="submit" name="submit" value=" {@"Go"} " />
+ <%-T("Go to bug ID")%> <input type="text" name="bugid" size="5" /> <input type="submit" name="submit" value=" <%-T("Go")%> " />
</form>
</div>
</div>
</div>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title>{$bugsys->options['trackertitle']} - {@"Register"}</title>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Register")%></title>
</head>
<body>
-$header
+<%- $header %>
-<if condition="$show['errors']">
-<div class="error" style="text-align: $stylevar[left]">
- {@"The following errors occurred"}:
- {$message->errorBox}
+<% if ($show['errors']): %>
+<div class="error" style="text-align: <%- $stylevar['left'] %>">
+ <%-T("The following errors occurred")%>:
+ <%- $message->errorBox %>
</div>
-</if>
+<% endif %>
<form action="register.php" name="register" method="post">
<input type="hidden" name="do" value="insert" />
<div align="center" style="margin-top: 10px">
<div class="box altwidth">
- <div class="box-head">{@"Register"}</div>
+ <div class="box-head"><%-T("Register")%></div>
<div class="box-mid">
- <div><strong>{@"Email"}:</strong> <input type="text" name="email" size="30" value="{$bugsys->in['email']}" /></div>
- <div><strong>{@"Confirm Email"}:</strong> <input type="text" name="confirmemail" size="30" value="{$bugsys->in['confirmemail']}" /></div>
- <div><strong>{@"Display Name"}:</strong> <input type="text" name="displayname" size="30" value="{$bugsys->in['displayname']}" /></div>
- <div><strong>{@"Password"}:</strong> <input type="password" name="password" size="30" /></div>
- <div><strong>{@"Confirm Password"}:</strong> <input type="password" name="confirmpassword" size="30" /></div>
- <div><strong>{@"Show My Email Publicly"}:</strong> <input type="checkbox" value="1" name="showemail"<if condition="$bugsys->in['showemail']"> checked="checked"</if> /> {@"Yes"}</div>
- <div><strong>{@"Language"}:</strong> <select name="languageid">$opts</select></div>
+ <div><strong><%-T("Email")%>:</strong> <input type="text" name="email" size="30" value="<%- $input->in['email'] %>" /></div>
+ <div><strong><%-T("Confirm Email")%>:</strong> <input type="text" name="confirmemail" size="30" value="<%- $input->in['confirmemail'] %>" /></div>
+ <div><strong><%-T("Display Name")%>:</strong> <input type="text" name="displayname" size="30" value="<%- $input->in['displayname'] %>" /></div>
+ <div><strong><%-T("Password")%>:</strong> <input type="password" name="password" size="30" /></div>
+ <div><strong><%-T("Confirm Password")%>:</strong> <input type="password" name="confirmpassword" size="30" /></div>
+ <div><strong><%-T("Show My Email Publicly")%>:</strong> <input type="checkbox" value="1" name="showemail"<% if ($input->in['showemail']): %> checked="checked"<% endif %> /> <%-T("Yes")%></div>
+ <div><strong><%-T("Language")%>:</strong> <select name="languageid"><%- $opts %></select></div>
</div>
<div class="box-foot box-center">
- <input type="submit" name="submit" value=" {@"Register"} " accesskey="s" />
- <input type="reset" name="reset" value=" {@"Reset"} " accesskey="r" />
+ <input type="submit" name="submit" value=" <%-T("Register")%> " accesskey="s" />
+ <input type="reset" name="reset" value=" <%-T("Reset")%> " accesskey="r" />
</div>
</div>
</div>
</form>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/report.css" media="screen" />
<link rel="stylesheet" type="text/css" href="templates/fields.css" media="screen" />
- <title>{$bugsys->options['trackertitle']} - {@"Search"}</title>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Search")%></title>
</head>
<body>
-$header
+<%- $header %>
-<if condition="$searches">
-<form style="float: $stylevar[right]; display: inline" action="search.php" method="get">
-{@"Run Saved Search"}: <select name="searchid">$searches</select>
-<input type="submit" value=" {@"Go"} " />
+<% if ($searches): %>
+<form style="float: <%- $stylevar[right] %>; display: inline" action="search.php" method="get">
+<%-T("Run Saved Search")%>: <select name="searchid"><%- $searches %></select>
+<input type="submit" value=" <%-T("Go")%> " />
</form>
-</if>
+<% endif %>
-<p>{@"Any fields left blank or unselected will be excluded from the search query."}</p>
+<p><%-T("Any fields left blank or unselected will be excluded from the search query.")%></p>
<form name="search" action="search.php" method="post" class="form">
<input type="hidden" name="do" value="process" />
<!-- search mode -->
<fieldset>
- <legend>{@"Search Mode"}</legend>
+ <legend><%-T("Search Mode")%></legend>
<div class="field">
<select name="mode">
- <option value="1" selected="selected">{@"Any Words"}</option>
- <option value="2">{@"All Words"}</option>
- <option value="3">{@"Raw Boolean Search"}</option>
+ <option value="1" selected="selected"><%-T("Any Words")%></option>
+ <option value="2"><%-T("All Words")%></option>
+ <option value="3"><%-T("Raw Boolean Search")%></option>
</select>
</div>
</fieldset>
<!-- reporter -->
<fieldset>
- <legend>{@"Reporter"} $help[reporter]</legend>
+ <legend><%-T("Reporter")%> $help[reporter]</legend>
<div class="field"><input type="text" name="reporter" size="25" style="width: 100%" /></div>
</fieldset>
<!-- / reporter -->
<!-- product & version -->
<fieldset>
- <legend>{@"Product / Version"} $help[product]</legend>
- <div class="field"><select name="product[]" size="10" multiple="multiple">$productSelect</select></div>
+ <legend><%-T("Product / Version")%> $help[product]</legend>
+ <div class="field"><select name="product[]" size="10" multiple="multiple"><%- $productSelect %></select></div>
</fieldset>
<!-- / product & version -->
<!-- status -->
<fieldset>
- <legend>{@"Status"} $help[status]</legend>
- <div class="field"><select name="status[]" size="4" multiple="multiple">$select[status]</select></div>
+ <legend><%-T("Status")%> $help[status]</legend>
+ <div class="field"><select name="status[]" size="4" multiple="multiple"><%- $select['status'] %></select></div>
</fieldset>
<!-- / status -->
<!-- priority -->
<fieldset>
- <legend>{@"Priority"} $help[priority]</legend>
- <div class="field"><select name="priority[]" size="4" multiple="multiple">$select[priority]</select></div>
+ <legend><%-T("Priority")%> $help[priority]</legend>
+ <div class="field"><select name="priority[]" size="4" multiple="multiple"><%- $select['priority'] %></select></div>
</fieldset>
<!-- / priority -->
<!-- date -->
<fieldset>
- <legend>{@"Date (submitted since)"}</legend>
+ <legend><%-T("Date (submitted since)")%></legend>
<div class="field">
<select name="date">
- <option value="0">{@"Any Date"}</option>
- <option value="1">{@"Today"}</option>
- <option value="2">{@"Yesterday"}</option>
+ <option value="0"><%-T("Any Date")%></option>
+ <option value="1"><%-T("Today")%></option>
+ <option value="2"><%-T("Yesterday")%></option>
<option value="7">{@"1 Week"}</option>
<option value="15">{@"15 Days"}</option>
<option value="30">{@"30 Days"}</option>
</fieldset>
<!-- / date -->
- $customfields[left]
+ <%- $customfields['left'] %>
</div>
<!-- / LEFT COLUMN -->
<!-- summary -->
<fieldset>
- <legend>{@"Summary / Comment Text"}</legend>
+ <legend><%-T("Summary / Comment Text")%></legend>
<div class="field"><input type="text" name="summary" size="25" style="width: 100%" /></div>
</fieldset>
<!-- / summary -->
<!-- sort by -->
<fieldset>
- <legend>{@"Sort By"}</legend>
+ <legend><%-T("Sort By")%></legend>
<div class="field">
<select name="sortby">
- <option value="relevance">{@"Relevance"}</option>
- <option value="bugid">{@"Bug ID"}</option>
- <option value="severity">{@"Severity"}</option>
- <option value="priority">{@"Priority"}</option>
- <option value="status">{@"Status"}</option>
- <option value="resolution">{@"Resolution"}</option>
- <option value="dateline">{@"Date"}</option>
+ <option value="relevance"><%-T("Relevance")%></option>
+ <option value="bugid"><%-T("Bug ID")%></option>
+ <option value="severity"><%-T("Severity")%></option>
+ <option value="priority"><%-T("Priority")%></option>
+ <option value="status"><%-T("Status")%></option>
+ <option value="resolution"><%-T("Resolution")%></option>
+ <option value="dateline"><%-T("Date")%></option>
</select>
<select name="orderby">
- <option value="asc" selected="selected">{@"Ascending"}</option>
- <option value="desc">{@"Descending"}</option>
+ <option value="asc" selected="selected"><%-T("Ascending")%></option>
+ <option value="desc"><%-T("Descending")%></option>
</select>
</div>
</fieldset>
<!-- assignment -->
<fieldset>
- <legend>{@"Assignment"} $help[assignedto]</legend>
- <div class="field"><select name="assignedto[]" size="4" multiple="multiple">$select[dev]</select></div>
+ <legend><%-T("Assignment")%> $help[assignedto]</legend>
+ <div class="field"><select name="assignedto[]" size="4" multiple="multiple"><%- $select['dev'] %></select></div>
</fieldset>
<!-- / assignment -->
<!-- resolution -->
<fieldset>
- <legend>{@"Resolution"} $help[resolution]</legend>
- <div class="field"><select name="resolution[]" size="4" multiple="multiple">$select[resolution]</select></div>
+ <legend><%-T("Resolution")%> $help[resolution]</legend>
+ <div class="field"><select name="resolution[]" size="4" multiple="multiple"><%- $select['resolution'] %></select></div>
</fieldset>
<!-- / resolution -->
<!-- severity -->
<fieldset>
- <legend>{@"Severity"} $help[severity]</legend>
- <div class="field"><select name="severity[]" size="4" multiple="multiple">$select[severity]</select></div>
+ <legend><%-T("Severity")%> $help[severity]</legend>
+ <div class="field"><select name="severity[]" size="4" multiple="multiple"><%- $select['severity'] %></select></div>
</fieldset>
<!-- / severity -->
- <if condition="$bugsys->userinfo['userid']">
+ <% if (bugdar::$userinfo['userid']): %>
<!-- favorite -->
<fieldset>
- <legend>{@"Favorite"}</legend>
+ <legend><%-T("Favorite")%></legend>
<div class="field">
<select name="favorite">
- <option value="0">{@"Ignore"}</option>
- <option value="1">{@"Yes"}</option>
- <option value="-1">{@"No"}</option>
+ <option value="0"><%-T("Ignore")%></option>
+ <option value="1"><%-T("Yes")%></option>
+ <option value="-1"><%-T("No")%></option>
</select>
</div>
</fieldset>
<!-- / favorite -->
- </if>
+ <% endif %>
- $customfields[right]
+ <%- $customfields['right'] %>
</div>
<!-- / RIGHT COLUMN -->
<div class="clearspill"></div>
<div id="submitrow">
- <input type="submit" name="submit" value=" {@"Search Reports"} " accesskey="s" />
- <input type="reset" name="reset" value=" {@"Reset Fields"} " accesskey="r" />
+ <input type="submit" name="submit" value=" <%-T("Search Reports")%> " accesskey="s" />
+ <input type="reset" name="reset" value=" <%-T("Reset Fields")%> " accesskey="r" />
</div>
</form>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
- <title>{$bugsys->options['trackertitle']} - {@"Search Results"}</title>
+<%- $headinclude %>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Search Results")%></title>
</head>
<body>
-$header
+<%- $header %>
-<if condition="$show['cached']">
-<div style="font-weight: bold"><a href="search.php?new=1">{@"This search has been cached for your convenience. You can perform a new search by clicking here."}</a></div>
-<div><a href="search.php?rerun=1&searchid=$searchid">{@"Alternatively, you can re-run this search by clicking here."}</a></div>
+<% if ($show['cached']): %>
+<div style="font-weight: bold"><a href="search.php?new=1"><%-T("This search has been cached for your convenience. You can perform a new search by clicking here.")%></a></div>
+<div><a href="search.php?rerun=1&searchid=<%- $searchid %>"><%-T("Alternatively, you can re-run this search by clicking here.")%></a></div>
<br />
-</if>
+<% endif %>
<table class="table">
<tr class="listinghead">
-$columnHeads
+<%- $columnHeads %>
</tr>
-$bugs
+<%- $bugs %>
</table>
<div>
- <a href="search.php?do=export&searchid=$searchid">[{@"Export results as XML"}]</a>
- <if condition="$show['save']"><a href="search.php?do=save&searchid=$searchid">[{@"Save Search"}]</a></if>
- <if condition="$show['update']"><a href="search.php?do=update&searchid=$searchid">[{@"Mass Update Bugs in Result"}]</a></if>
+ <a href="search.php?do=export&searchid=<%- $searchid %>">[<%-T("Export results as XML")%>]</a>
+ <% if ($show['save']): %><a href="search.php?do=save&searchid=<%- $searchid %>">[<%-T("Save Search")%>]</a><% endif %>
+ <% if ($show['update']): %><a href="search.php?do=update&searchid=<%- $searchid %>">[<%-T("Mass Update Bugs in Result")%>]</a><% endif %>
</div>
-<if condition="$show['pagenav']">
+<% if ($show['pagenav']): %>
<!-- pagenav -->
-<div align="$stylevar[right]">
-$pagenav
+<div align="<%- $stylevar[right] %>">
+<%- $pagenav %>
</div>
<!-- / pagenav -->
-</if>
+<% endif %>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title>{$bugsys->options['trackertitle']} - {@"Save Search"}</title>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Save Search")%></title>
</head>
<body>
-$header
+<%- $header %>
-<if condition="$show['errors']">
-<div class="error" style="text-align: $stylevar[left]">
- {@"The following errors occurred"}:
- {$message->errorBox}
+<% if ($show['errors']): %>
+<div class="error" style="text-align: <%- $stylevar[left] %>">
+ <%-T("The following errors occurred")%>:
+ <%- $message->errorBox %>
</div>
-</if>
+<% endif %>
<form action="search.php" name="register" method="post">
<input type="hidden" name="do" value="dosave" />
-<input type="hidden" name="searchid" value="{$bugsys->in['searchid']}" />
+<input type="hidden" name="searchid" value="<%- $searchid %>" />
<div align="center" style="margin-top: 10px">
<div class="box altwidth">
- <div class="box-head">{@"Save Search"}</div>
+ <div class="box-head"><%-T("Save Search")%></div>
<div class="box-mid">
- {@"You can save this search criteria for later by naming this search."}
+ <%-T("You can save this search criteria for later by naming this search.")%>
<br />
<br />
- <div><strong>{@"Name"}:</strong> <input type="text" name="name" size="30" maxlength="250" value="{$bugsys->in['name']}" /></div>
+ <div><strong><%-T("Name")%>:</strong> <input type="text" name="name" size="30" maxlength="250" value="<%- $name %>" /></div>
</div>
<div class="box-foot box-center">
- <input type="submit" name="submit" value=" {@"Save"} " accesskey="s" />
- <input type="reset" name="reset" value=" {@"Reset"} " accesskey="r" />
+ <input type="submit" name="submit" value=" <%-T("Save")%> " accesskey="s" />
+ <input type="reset" name="reset" value=" <%-T("Reset")%> " accesskey="r" />
</div>
</div>
</div>
</form>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/report.css" media="screen" />
<link rel="stylesheet" type="text/css" href="templates/fields.css" media="screen" />
- <title>{$bugsys->options['trackertitle']} - {@"Mass Update"}</title>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Mass Update")%></title>
</head>
<body>
-$header
+<%- $header %>
-<p>{@"Any fields left blank or unselected will not be changed."}</p>
+<p><%-T("Any fields left blank or unselected will not be changed.")%></p>
<form name="search" action="search.php" method="post" class="form">
<input type="hidden" name="do" value="doupdate" />
-<input type="hidden" name="searchid" value="$search[searchid]" />
+<input type="hidden" name="searchid" value="<%- $search['searchid'] %>" />
<div id="fieldbody">
<!-- LEFT COLUMN -->
<!-- product & version -->
<fieldset>
- <legend>{@"Product / Version"} $help[product]</legend>
- <div class="field"><select name="product"><option value=""> </option>$productSelect</select></div>
+ <legend><%-T("Product / Version")%> $help[product]</legend>
+ <div class="field"><select name="product"><option value=""> </option><%- $productSelect %></select></div>
</fieldset>
<!-- / product & version -->
<!-- status -->
<fieldset>
- <legend>{@"Status"} $help[status]</legend>
- <div class="field"><select name="status">$select[status]</select></div>
+ <legend><%-T("Status")%> $help[status]</legend>
+ <div class="field"><select name="status"><%- $select['status'] %></select></div>
</fieldset>
<!-- / status -->
<!-- priority -->
<fieldset>
- <legend>{@"Priority"} $help[priority]</legend>
- <div class="field"><select name="priority">$select[priority]</select></div>
+ <legend><%-T("Priority")%> $help[priority]</legend>
+ <div class="field"><select name="priority"><%- $select['priority'] %></select></div>
</fieldset>
<!-- / priority -->
- $customfields[left]
+ <%- $customfields['left'] %>
</div>
<!-- / LEFT COLUMN -->
<!-- assignment -->
<fieldset>
- <legend>{@"Assignment"} $help[assignedto]</legend>
- <div class="field"><select name="assignedto">$select[dev]</select></div>
+ <legend><%-T("Assignment")%> $help[assignedto]</legend>
+ <div class="field"><select name="assignedto"><%- $select['dev'] %></select></div>
</fieldset>
<!-- / assignment -->
<!-- resolution -->
<fieldset>
- <legend>{@"Resolution"} $help[resolution]</legend>
- <div class="field"><select name="resolution">$select[resolution]</select></div>
+ <legend><%-T("Resolution")%> $help[resolution]</legend>
+ <div class="field"><select name="resolution"><%- $select['resolution'] %></select></div>
</fieldset>
<!-- / resolution -->
<!-- severity -->
<fieldset>
- <legend>{@"Severity"} $help[severity]</legend>
- <div class="field"><select name="severity">$select[severity]</select></div>
+ <legend><%-T("Severity")%> $help[severity]</legend>
+ <div class="field"><select name="severity"><%- $select['severity'] %></select></div>
</fieldset>
<!-- / severity -->
- <if condition="$bugsys->userinfo['userid']">
+ <% if (bugdar::$userinfo['userid']): %>
<!-- favorite -->
<fieldset>
- <legend>{@"Favorite"}</legend>
+ <legend><%-T("Favorite")%></legend>
<div class="field">
<select name="favorite">
- <option value="0">{@"Ignore"}</option>
- <option value="1">{@"Yes"}</option>
- <option value="-1">{@"No"}</option>
+ <option value="0"><%-T("Ignore")%></option>
+ <option value="1"><%-T("Yes")%></option>
+ <option value="-1"><%-T("No")%></option>
</select>
</div>
</fieldset>
<!-- / favorite -->
- </if>
+ <% endif %>
- $customfields[right]
+ <%- $customfields['right'] %>
</div>
<!-- / RIGHT COLUMN -->
<div class="clearspill"></div>
<div id="submitrow">
- <input type="submit" name="submit" value=" {@"Update Results"} " accesskey="s" />
- <input type="reset" name="reset" value=" {@"Reset Fields"} " accesskey="r" />
+ <input type="submit" name="submit" value=" <%-T("Update Results")%> " accesskey="s" />
+ <input type="reset" name="reset" value=" <%-T("Reset Fields")%> " accesskey="r" />
</div>
</form>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-<optgroup label="$glabel">
-$optbits
+<optgroup label="<%- $glabel %>">
+<%- $optbits %>
</optgroup>
\ No newline at end of file
-<option value="$value"<if condition="$selected"> selected="selected"</if>>$label</option>
\ No newline at end of file
+<option value="<%- $value %>"<% if ($selected): %> selected="selected"<% endif %>><%- $label %></option>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/report.css" media="screen" />
<link rel="stylesheet" type="text/css" href="templates/fields.css" media="screen" />
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title><lang 1="$bug[bugid]">{@"Bug Report %1$s"}</lang> - $bug[summary_title]</title>
+ <title><%- sprintf(T('Bug Report %1$s'), $bug['bugid']) %> - <%- $bug['summary_title'] %></title>
</head>
<body>
-$header
+<%- $header %>
<form name="bugreport" action="editreport.php" method="post" class="form">
<input type="hidden" name="do" value="update" />
-<input type="hidden" name="bugid" value="$bug[bugid]" />
+<input type="hidden" name="bugid" value="<%- $bug['bugid'] %>" />
<div id="fieldbody">
<!-- LEFT COLUMN -->
- <div id="$stylevar[left]col">
+ <div id="<%- $stylevar['left'] %>col">
<!-- bug id & hidden -->
<fieldset>
- <legend>{@"Bug Id"} $help[bugid]</legend>
+ <legend><%-T("Bug Id")%> $help[bugid]</legend>
<div class="field">
- $bug[bugid]
+ <%- $bug['bugid'] %>
- <if condition="$show['edit']">
+ <% if ($show['edit']): %>
/
- <strong<if condition="$bug['hidden']"> class="error"</if>>{@"Hidden"}:</strong>
- <input type="checkbox" name="hidden" value="1"<if condition="$bug['hidden']"> checked="checked"</if> />
- <else />
- <if condition="$bug['hidden']"> / <span class="error">{@"Hidden Bug"}</span></if>
- </if>
-
- / [<a href="showhistory.php?bugid=$bug[bugid]">{@"Show Bug History"}</a>]
- <if condition="$show['subscribe']">/ [<a href="favorite.php?do=handle&bugid=$bug[bugid]">$favoritetext</a>]</if>
- <if condition="$show['delete']">/ [<a href="editreport.php?do=delete&bugid=$bug[bugid]">{@"Delete"}</a>]</if>
+ <strong<% if ($bug['hidden']): %> class="error"<% endif %>><%-T("Hidden")%>:</strong>
+ <input type="checkbox" name="hidden" value="1"<% if ($bug['hidden']): %> checked="checked"<% endif %> />
+ <% else: %>
+ <% if ($bug['hidden']): %> / <span class="error"><%-T("Hidden Bug")%></span><% endif %>
+ <% endif %>
+
+ / [<a href="showhistory.php?bugid=<%- $bug['bugid'] %>"><%-T("Show Bug History")%></a>]
+ <% if ($show['subscribe']): %>/ [<a href="favorite.php?do=handle&bugid=<%- $bug['bugid'] %>"><%- $favoritetext %></a>]<% endif %>
+ <% if ($show['delete']): %>/ [<a href="editreport.php?do=delete&bugid=<%- $bug['bugid'] %>"><%-T("Delete")%></a>]<% endif %>
</div>
</fieldset>
<!-- / bug id & hidden -->
<!-- reporter -->
<fieldset>
- <legend>{@"Reporter"} $help[reporter]</legend>
- <div class="field">$bug[userinfo]</div>
+ <legend><%-T("Reporter")%> $help[reporter]</legend>
+ <div class="field"><%- $bug['userinfo'] %></div>
</fieldset>
<!-- / reporter -->
<!-- product -->
<fieldset>
- <legend><a href="explain.php?do=products">{@"Product/Version"}</a> $help[product]</legend>
- <div class="field">$bug[product] <if condition="$bug['component']">/ $bug[component]</if> / <if condition="$show['edit']"><select name="product">$productSelect</select><else />$bug[version]</if></div>
+ <legend><a href="explain.php?do=products"><%-T('Product/Version') %></a> $help[product]</legend>
+ <div class="field"><%- $bug['product'] %> <% if ($bug['component']): %>/ <%- $bug['component'] %><% endif %> / <% if ($show['edit']): %><select name="product"><%- $productSelect %></select><% else: %><%- $bug['version'] %><% endif %></div>
</fieldset>
<!-- / product -->
<!-- status -->
<fieldset>
- <legend>{@"Status"} $help[status]</legend>
+ <legend><%-T("Status")%> $help[status]</legend>
<div class="field">
- <if condition="$show['changestatus']">
- <select name="status">$select[status]</select>
- <else />
- $bug[status]
- </if>
+ <% if ($show['changestatus']): %>
+ <select name="status"><%- $select['status'] %></select>
+ <% else: %>
+ <%- $bug['status'] %>
+ <% endif %>
</div>
</fieldset>
<!-- / status -->
<!-- severity -->
<fieldset>
- <legend>{@"Severity"} $help[severity]</legend>
+ <legend><%-T("Severity")%> $help[severity]</legend>
<div class="field">
- <if condition="$show['edit']">
- <select name="severity">$select[severity]</select>
- <else />
- $bug[severity]
- </if>
+ <% if ($show['edit']): %>
+ <select name="severity"><%- $select['severity'] %></select>
+ <% else: %>
+ <%- $bug['severity'] %>
+ <% endif %>
</div>
</fieldset>
<!-- / severity -->
<!-- duplicate -->
<fieldset>
- <legend>{@"Duplicate Of"} $help[duplicateof]</legend>
+ <legend><%-T("Duplicate Of")%> $help[duplicateof]</legend>
<div class="field">
- <if condition="$show['edit']">
- <input type="text" name="duplicateof" size="10" value="<if condition="$bug['duplicateof']">$bug[duplicateof]</if>" />
- <if condition="$bug['duplicateof']"><a href="showreport.php?bugid=$bug[duplicateof]" title="$duplicate[summary]" target="_blank">$duplicate[bugid]</a></if>
- <else />
- <if condition="$bug['duplicateof']"><a href="showreport.php?bugid=$bug[duplicateof]">$duplicateof[summary]</a><else />{@"- none -"}</if>
- </if>
+ <% if ($show['edit']): %>
+ <input type="text" name="duplicateof" size="10" value="<% if ($bug['duplicateof']): %><%- $bug['duplicateof'] %><% endif %>" />
+ <% if ($bug['duplicateof']): %><a href="showreport.php?bugid=<%- $bug['duplicateof'] %>" title="<%- $duplicate['summary'] %>" target="_blank"><%- $duplicate['bugid'] %></a><% endif %>
+ <% else: %>
+ <% if ($bug['duplicateof']): %><a href="showreport.php?bugid=<%- $bug['duplicateof'] %>"><%- $duplicateof['summary'] %></a><% else: %><%- T("- none -") %><% endif %>
+ <% endif %>
</div>
</fieldset>
<!-- / duplicate -->
- $customfields[left]
+ <%- $customfields['left'] %>
</div>
<!-- / LEFT COLUMN -->
<!-- RIGHT COLUMN -->
- <div id="$stylevar[right]col">
+ <div id="<%- $stylevar['right'] %>col">
<!-- summary -->
<fieldset>
- <legend>{@"Summary"} $help[summary]</legend>
+ <legend><%-T("Summary")%> $help[summary]</legend>
<div class="field">
- <if condition="$show['edit']">
- <input type="text" name="summary" size="25" value="$bug[summary]" style="width: 100%" maxlength="250" />
- <else />
- $bug[summary]
- </if>
+ <% if ($show['edit']): %>
+ <input type="text" name="summary" size="25" value="<%- $bug['summary'] %>" style="width: 100%" maxlength="250" />
+ <% else: %>
+ <%- $bug['summary'] %>
+ <% endif %>
</div>
</fieldset>
<!-- / summary -->
<!-- reporting time -->
<fieldset>
- <legend>{@"Report Time"} $help[dateline]</legend>
- <div class="field">$bug[datetime]</div>
+ <legend><%-T("Report Time")%> $help[dateline]</legend>
+ <div class="field"><%- $bug['datetime'] %></div>
</fieldset>
<!-- / reporting time -->
<!-- assignment -->
<fieldset>
- <legend>{@"Assignment"} $help[assignedto]</legend>
+ <legend><%-T("Assignment")%> $help[assignedto]</legend>
<div class="field">
- <if condition="$show['assign']">
- <select name="assignedto"><option value="0"<if condition="!$bug['assignedto']"> selected="selected"</if>>{@"No Assignment"}</option>$select[dev]</select>
- <else />
- <if condition="$bug['assigninfo']">$bug[assigninfo]<else />{@"- none -"}</if>
- </if>
+ <% if ($show['assign']): %>
+ <select name="assignedto"><option value="0"<% if (!$bug['assignedto']): %> selected="selected"<% endif %>><%-T("No Assignment")%></option><%- $select['dev'] %></select>
+ <% else: %>
+ <% if ($bug['assigninfo']): %><%- $bug['assigninfo'] %><% else: %>{@"- none -"}<% endif %>
+ <% endif %>
</div>
</fieldset>
<!-- / assignment -->
<!-- resolution -->
<fieldset>
- <legend>{@"Resolution"} $help[resolution]</legend>
+ <legend><%-T("Resolution")%> $help[resolution]</legend>
<div class="field">
- <if condition="$show['changestatus']">
- <select name="resolution">$select[resolution]</select>
- <else />
- $bug[resolution]
- </if>
+ <% if ($show['changestatus']): %>
+ <select name="resolution"><%- $select['resolution'] %></select>
+ <% else: %>
+ <%- $bug['resolution'] %>
+ <% endif %>
</div>
</fieldset>
<!-- / resolution -->
<!-- priority -->
<fieldset>
- <legend>{@"Priority"} $help[priority]</legend>
+ <legend><%-T("Priority")%> $help[priority]</legend>
<div class="field">
- <if condition="$show['changestatus']">
- <select name="priority">$select[priority]</select>
- <else />
- $bug[priority]
- </if>
+ <% if ($show['changestatus']): %>
+ <select name="priority"><%- $select['priority'] %></select>
+ <% else: %>
+ <%- $bug['priority'] %>
+ <% endif %>
</div>
</fieldset>
<!-- / priority -->
<!-- dependencies -->
<fieldset>
- <legend>{@"Dependencies"} $help[dependency]</legend>
+ <legend><%-T("Dependencies")%> $help[dependency]</legend>
<div class="field">
- <if condition="$show['edit']">
- <input type="text" name="dependency" size="25" value="$bug[dependency]" /> $dependencies
- <else />
- <if condition="$dependencies">$dependencies<else />{@"- none -"}</if>
- </if>
+ <% if ($show['edit']): %>
+ <input type="text" name="dependency" size="25" value="<%- $bug['dependency'] %>" /> <%- $dependencies %>
+ <% else: %>
+ <% if ($dependencies): %><%- $dependencies %><% else: %><%- T("- none -") %><% endif %>
+ <% endif %>
</div>
</fieldset>
<!-- / dependencies -->
- $customfields[right]
+ <%- $customfields['right'] %>
</div>
<!-- / RIGHT COLUMN -->
</div>
<br />
-<if condition="$show['newreply']">
+<% if ($show['newreply']): %>
<!-- new reply -->
<div style="width: 100%">
<fieldset>
- <legend>{@"New Reply"}<if condition="$show['automations']"> : <a href="explain.php?do=automations">{@"Automation"}</a> <select name="automation">$select[automation]</select></if> $help[newreply]</legend>
+ <legend><%-T("New Reply")%><% if ($show['automations']): %> : <a href="explain.php?do=automations"><%-T("Automation")%></a> <select name="automation"><%- $select['automation'] %></select><% endif %> $help[newreply]</legend>
<textarea name="comment" cols="50" rows="10" class="textarea"></textarea>
- <div><input type="checkbox" name="parselinks" value="1"<if condition="$bugsys->in['parselinks']"> checked="checked"</if> /> {@"Parse Links in the Comment"}</div>
+ <div><input type="checkbox" name="parselinks" value="1"<% if ($input->in['parselinks']): %>> checked="checked"<% endif %> /> <%-T("Parse Links in the Comment")%></div>
</fieldset>
</div>
<!-- / new reply -->
-</if>
+<% endif %>
<!-- submit row -->
<div id="submitrow">
- <input type="submit" name="submit" value=" {@"Commit Changes"} " accesskey="s" />
- <input type="reset" name="reset" value=" {@"Reset Fields"} " accesskey="r" />
+ <input type="submit" name="submit" value=" <%-T("Commit Changes")%> " accesskey="s" />
+ <input type="reset" name="reset" value=" <%-T("Reset Fields")%> " accesskey="r" />
</div>
<!-- / submit row -->
<!-- attachments & voting -->
<div id="attachvote">
- <if condition="$show['attachments']">
+ <% if ($show['attachments']): %>
<!-- attachments -->
- <div id="attachments" style="float: $stylevar[right]">
+ <div id="attachments" style="float: <%- $stylevar['right'] %>">
<fieldset>
- <legend>{@"Attachments"}<if condition="$show['putattachments']"> : <a href="attachment.php?do=add&bugid=$bug[bugid]">{@"New"}</a></if></legend>
+ <legend><%-T("Attachments")%><% if ($show['putattachments']): %> : <a href="attachment.php?do=add&bugid=<%- $bug['bugid'] %>"><%-T("New")%></a><% endif %></legend>
- $attachments
+ <%- $attachments %>
</fieldset>
</div>
<!-- / attachments -->
- </if>
+ <% endif %>
<!-- show votes -->
- <div id="votes<if condition="$show['attachments']"><if condition="!$show['vote']">fifty</if><else /><if condition="!$show['vote']">hundred</if></if>">
+ <div id="votes<% if ($show['attachments']): %><% if (!$show['vote']): %>fifty<% endif %><% else: %><% if (!$show['vote']): %>hundred<% endif %><% endif %>">
<fieldset>
- <legend>{@"Votes"}</legend>
+ <legend><%-T("Votes")%></legend>
- <div><strong>{@"For"}:</strong> $vote[votefor] ($vote[forpercent]%)</div>
- <div><strong>{@"Against"}:</strong> $vote[voteagainst] ($vote[againstpercent]%)</div>
- <div><strong>{@"Total"}:</strong> $vote[total]</div>
+ <div><strong><%-T("For")%>:</strong> <%- $vote['votefor'] %> (<%- $vote['forpercent'] %>%)</div>
+ <div><strong><%-T("Against")%>:</strong> <%- $vote['voteagainst'] %> (<%- $vote['againstpercent'] %>%)</div>
+ <div><strong><%-T("Total")%>:</strong> <%- $vote['total'] %></div>
</fieldset>
</div>
<!-- / show votes -->
- <if condition="$show['vote']">
+ <% if ($show['vote']): %>
<!-- your vote -->
<div id="yourvote">
<fieldset>
- <legend>{@"Your Vote"}</legend>
+ <legend><%-T("Your Vote")%></legend>
<form name="vote" action="vote.php" method="post" class="form">
<input type="hidden" name="do" value="vote" />
- <input type="hidden" name="bugid" value="$bug[bugid]" />
- <input type="radio" name="vote" value="1" /> {@"Vote For (+1)"}<br />
- <input type="radio" name="vote" value="-1" /> {@"Vote Against (-1)"}<br />
+ <input type="hidden" name="bugid" value="<%- $bug['bugid'] %>" />
+ <input type="radio" name="vote" value="1" /> <%-T("Vote For (+1)")%><br />
+ <input type="radio" name="vote" value="-1" /> <%-T("Vote Against (-1)")%><br />
- <input type="submit" name="submit" value=" {@"Vote"} " accesskey="v" />
+ <input type="submit" name="submit" value=" <%-T("Vote")%> " accesskey="v" />
</form>
</fieldset>
</div>
<!-- / your vote -->
- </if>
+ <% endif %>
</div>
<!-- / attachments & voting -->
<br />
-$comments
+<%- $comments %>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
<div>
- <if condition="$show['editattach']"><span style="float: $stylevar[right]; font-size: 10px">[<a href="attachment.php?do=edit&attachmentid=$attachment[attachmentid]">{@"Edit"}</a>]</span></if>
- <strong><a href="viewattachment.php?attachmentid=$attachment[attachmentid]" target="_blank"<if condition="$attachment['obsolete']"> style="text-decoration: line-through"</if> title="<lang 1="$attachment[user]">{@"Posted by %1$s"}</lang>\n($attachment[date])">$attachment[filename]</a></strong>
- <span style="font-size: 10px">$attachment[description]</span>
+ <% if ($show['editattach']): %><span style="float: <%- $stylevar['right'] %>; font-size: 10px">[<a href="attachment.php?do=edit&attachmentid=<%- $attachment['attachmentid'] %>"><%-T("Edit")%></a>]</span><% endif %>
+ <strong><a href="viewattachment.php?attachmentid=<%- $attachment['attachmentid'] %>" target="_blank"<% if ($attachment['obsolete']): %> style="text-decoration: line-through"<% endif %> title="<%- sprintf(T('Posted by %1$s'), $attachment['user']) %>\n(<%- $attachment['date'] %>)"><%- $attachment['filename'] %></a></strong>
+ <span style="font-size: 10px"><%- $attachment['description'] %></span>
</div>
-<!-- comment $comment[commentid] -->
+<!-- comment <%- $comment['commentid'] %> -->
<div class="box">
- <div class="box-head" style="text-align: $stylevar[left]">
- <span style="float: $stylevar[right]">$comment[posttime]</span>
- $comment[postby]
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>">
+ <span style="float: <%- $stylevar['right'] %>"><%- $comment['posttime'] %></span>
+ <%- $comment['postby'] %>
</div>
- <div class="box-mid" style="text-align: $stylevar[left]">
- $comment[comment_parsed]
+ <div class="box-mid" style="text-align: <%- $stylevar['left'] %>">
+ <%- $comment['comment_parsed'] %>
</div>
- <if condition="$show['editcomment']">
- <div class="box-foot" style="text-align: $stylevar[left]">
- <span style="float: $stylevar[right]">
- <if condition="$show['delete']">[<a href="editcomment.php?do=delete&commentid=$comment[commentid]">{@"Delete"}</a>]</if>
- [<a href="editcomment.php?commentid=$comment[commentid]">{@"Edit Comment"}</a>]
+ <% if ($show['editcomment']): %>
+ <div class="box-foot" style="text-align: <%- $stylevar['left'] %>">
+ <span style="float: <%- $stylevar['right'] %>">
+ <% if ($show['delete']): %>[<a href="editcomment.php?do=delete&commentid=<%- $comment['commentid'] %>"><%-T("Delete")%></a>]<% endif %>
+ [<a href="editcomment.php?commentid=<%- $comment['commentid'] %>"><%-T("Edit Comment")%></a>]
</span>
- <if condition="$comment['hidden']"><strong>{@"Hidden"}</strong><else />{@"Visible"}</if>
+ <% if ($comment['hidden']): %><strong><%-T("Hidden")%></strong><% else: %><%-T("Visible")%><% endif %>
</div>
- </if>
+ <% endif %>
</div>
-<!-- / comment $comment[commentid] -->
+<!-- / comment <%- $comment['commentid'] %> -->
<br />
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title>{$bugsys->options['trackertitle']} - {@"Error"}</title>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Error")%></title>
</head>
<body>
-$header
+<%- $header %>
<div align="center" style="margin-top: 10px">
<div class="box altwidth">
- <div class="box-head" style="text-align: $stylevar[left]">{@"Error"}</div>
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>"><%-T("Error")%></div>
- <div class="box-mid box-overpad" style="text-align: $stylevar[left]">
- $error
+ <div class="box-mid box-overpad" style="text-align: <%- $stylevar['left'] %>">
+ <%- $error %>
</div>
</div>
</div>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <title>{$bugsys->options['trackertitle']} - <if condition="$show['confirm']">{@"Confirm"}<else />{@"Notice"}</if></title>
+ <title><%- bugdar::$options['trackertitle'] %> - <% if ($show['confirm']): %><%-T("Confirm")%><% else: %><%-T("Notice")%><% endif %></title>
</head>
<body>
-$header
+<%- $header %>
-<if condition="$show['confirm']">
-<form name="confirm" action="$action" method="post">
-<input type="hidden" name="do" value="$do" />
-$extra
-</if>
+<% if ($show['confirm']): %>
+<form name="confirm" action="<%- $action %>" method="post">
+<input type="hidden" name="do" value="<%- $do %>" />
+<%- $extra %>
+<% endif %>
<div align="center" style="margin-top: 10px">
<div class="box altwidth">
- <div class="box-head" style="text-align: $stylevar[left]"><if condition="$show['confirm']">{@"Confirm"}<else />{@"Notice"}</if></div>
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>"><% if ($show['confirm']): %><%-T("Confirm")%><% else: %><%-T("Notice")%><% endif %></div>
- <div class="box-mid box-overpad" style="text-align: $stylevar[left]">
- $message
+ <div class="box-mid box-overpad" style="text-align: <%- $stylevar['left'] %>">
+ <%- $message %>
- <if condition="$show['confirm']">
+ <% if ($show['confirm']): %>
<br />
<br />
<div id="submitrow">
- <input type="submit" name="submit" value="$button" />
- <script type="text/javascript"> draw_cancel("$cancel"); </script>
+ <input type="submit" name="submit" value="<%- $button %>" />
+ <script type="text/javascript"> draw_cancel("<%- $cancel %>"); </script>
</div>
- </if>
+ <% endif %>
</div>
</div>
</div>
-<if condition="$show['confirm']">
+<% if ($show['confirm']): %>
</form>
-</if>
+<% endif %>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
- <meta http-equiv="refresh" content="2; url=$url" />
- <title>{$bugsys->options['trackertitle']} - {@"Redirect..."}</title>
+ <meta http-equiv="refresh" content="2; url=<%- $url %>" />
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Redirect...")%></title>
</head>
<body>
-$header
+<%- $header %>
<div align="center" style="margin-top: 10px">
<div class="box altwidth">
- <div class="box-head" style="text-align: $stylevar[left]">{@"Redirect..."}</div>
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>"><%-T("Redirect...")%></div>
- <div class="box-mid box-overpad" style="text-align: $stylevar[left]">
- $message
+ <div class="box-mid box-overpad" style="text-align: <%- $stylevar['left'] %>">
+ <%- $message %>
<br />
<br />
- <a href="$url">{@"If you are not redirected in a few seconds, click here."}</a>
+ <a href="<%- $url %>"><%-T("If you are not redirected in a few seconds, click here.")%></a>
</div>
</div>
</div>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar[lang] %>" xml:lang="<%- $stylevar[lang] %>" dir="<%- $stylevar[lang_dir] %>">
<head>
-$headinclude
- <title>{$bugsys->options['trackertitle']} - {@"Bug Listing"}</title>
+<%- $headinclude %>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("Bug Listing")%></title>
</head>
<body>
-$header
+<%- $header %>
<table class="table">
<tr class="listinghead">
- $columnHeads</tr>
-$bugs
+ <%- $columnHeads %></tr>
+<%- $bugs %>
</table>
-<if condition="$show['pagenav']">
+<% if ($show['pagenav']): %>
<!-- pagenav -->
-<div align="$stylevar[right]">
-$pagenav
+<div align="<%- $stylevar[right] %>">
+<%- $pagenav %>
</div>
<!-- / pagenav -->
-</if>
+<% endif %>
-$footer
\ No newline at end of file
+<%- $footer %>
\ No newline at end of file
-<!-- bug $bug[bugid] -->
-<tr<if condition="$bugsys->userinfo['showcolors']"> style="background-color: $bug[bgcolor]<if condition="$bug['hidden']">; font-style: italic</if>"<else /> class="$bug[bgcolor]"<if condition="$bug['hidden']"> style="font-style: italic"</if></if>>
-$fields
+<!-- bug <%- $bug[bugid] %> -->
+<tr<% if (bugdar::$userinfo['showcolors']): %> style="background-color: <%- $bug['bgcolor'] %><% if ($bug['hidden']): %>; font-style: italic<% endif %>"<% else: %> class="<%- $bug['bgcolor'] %>"<% if ($bug['hidden']): %> style="font-style: italic"<% endif %><% endif %>>
+<%- $fields %>
</tr>
-<!-- / bug $bug[bugid] -->
+<!-- / bug <%- $bug[bugid] %> -->
-$doctype
-<html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<%- $doctype %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
<head>
-$headinclude
+<%- $headinclude %>
<link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
<link rel="stylesheet" type="text/css" href="templates/fields.css" media="screen" />
- <title>{$bugsys->options['trackertitle']} - {@"User Options"}</title>
+ <title><%- bugdar::$options['trackertitle'] %> - <%-T("User Options")%></title>
</head>
<body>
-$header
+<%- $header %>
<form action="userctrl.php" name="options" method="post">
<input type="hidden" name="do" value="update" />
-<if condition="$show['errors']">
-<div class="error" style="text-align: $stylevar[left]">
- {@"The following errors occurred"}:
- {$message->errorBox}
+<% if ($show['errors']): %>
+<div class="error" style="text-align: <%- $stylevar['left'] %>">
+ <%-T("The following errors occurred")%>:
+ <%- $message->errorBox %>
</div>
-</if>
+<% endif %>
<table class="table">
<tr valign="top">
<td width="50%">
<!-- user options -->
<div class="box">
- <div class="box-head" style="text-align: $stylevar[left]">{@"User Options"}</div>
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>"><%-T("User Options")%></div>
<div class="box-mid">
- <if condition="$bugsys->options['authmethod'] == 'default'">
+ <% if (bugdar::$options['authmethod'] == 'default'): %>
<fieldset>
- <legend>{@"Display Name"}</legend>
- <input type="text" name="displayname" value="{$userinfo['displayname']}" size="25" style="width: 100%" maxlength="250" />
+ <legend><%-T("Display Name")%></legend>
+ <input type="text" name="displayname" value="<%- $userinfo['displayname'] %>" size="25" style="width: 100%" maxlength="250" />
</fieldset>
- </if>
+ <% endif %>
<fieldset>
- <legend>{@"Show Email Publicly"}</legend>
- <input type="radio" name="showemail" value="1"<if condition="$userinfo['showemail']"> checked="checked"</if> /> {@"Yes"}
- <input type="radio" name="showemail" value="0"<if condition="!$userinfo['showemail']"> checked="checked"</if> /> {@"No"}
+ <legend><%-T("Show Email Publicly")%></legend>
+ <input type="radio" name="showemail" value="1"<% if ($userinfo['showemail']): %> checked="checked"<% endif %> /> <%-T("Yes")%>
+ <input type="radio" name="showemail" value="0"<% if (!$userinfo['showemail']): %> checked="checked"<% endif %> /> <%-T("No")%>
</fieldset>
<fieldset>
- <legend>{@"Show Status Colors on Bug Listings"}</legend>
- <input type="radio" name="showcolors" value="1"<if condition="$userinfo['showcolors']"> checked="checked"</if> /> {@"Yes"}
- <input type="radio" name="showcolors" value="0"<if condition="!$userinfo['showcolors']"> checked="checked"</if> /> {@"No"}
+ <legend><%-T("Show Status Colors on Bug Listings")%></legend>
+ <input type="radio" name="showcolors" value="1"<% if ($userinfo['showcolors']): %> checked="checked"<% endif %> /> <%-T("Yes")%>
+ <input type="radio" name="showcolors" value="0"<% if (!$userinfo['showcolors']): %> checked="checked"<% endif %> /> <%-T("No")%>
</fieldset>
<fieldset>
- <legend>{@"Language"}</legend>
- <select name="languageid">$langselect</select>
+ <legend><%-T("Language")%></legend>
+ <select name="languageid"><%- $langselect %></select>
</fieldset>
<fieldset>
- <legend>{@"Timezone"}</legend>
- <select name="timezone">$tzselect</select>
+ <legend><%-T("Timezone")%></legend>
+ <select name="timezone"><%- $tzselect %></select>
</fieldset>
<fieldset>
- <legend>{@"Observe Daylight Savings Time (DST)"}</legend>
- <input type="checkbox" name="usedst" value="1"<if condition="$userinfo['usedst']"> checked="checked"</if> /> {@"Yes, I'm currently observing DST"}
+ <legend><%-T("Observe Daylight Savings Time (DST)")%></legend>
+ <input type="checkbox" name="usedst" value="1"<% if ($userinfo['usedst']): %> checked="checked"<% endif %> /> <%-T("Yes, I'm currently observing DST")%>
</fieldset>
</div>
</div>
<!-- email options -->
<div class="box">
- <div class="box-head" style="text-align: $stylevar[left]">{@"Email Options"}</div>
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>"><%-T("Email Options")%></div>
<div class="box-mid">
<table class="table">
<tr style="text-align: center">
<td> </td>
- <td class="altcolor"><strong>{@"Reporter"}</strong></td>
- <td><strong>{@"Assignee"}</strong></td>
- <td class="altcolor"><strong>{@"Favorite"}</strong></td>
- <td><strong>{@"Voter"}</strong></td>
- <td class="altcolor"><strong>{@"Commenter"}</strong></td>
+ <td class="altcolor"><strong><%-T("Reporter")%></strong></td>
+ <td><strong><%-T("Assignee")%></strong></td>
+ <td class="altcolor"><strong><%-T("Favorite")%></strong></td>
+ <td><strong><%-T("Voter")%></strong></td>
+ <td class="altcolor"><strong><%-T("Commenter")%></strong></td>
</tr>
<tr class="altcolor textcenter">
- <td style="text-align: $stylevar[left]">{@"New bug is added"}</td>
- <td colspan="5"><input type="checkbox" name="emailopts[0][2048]"{$checked[0][2048]} value="1" /></td>
+ <td style="text-align: <%- $stylevar['left'] %>"><%-T("New bug is added")%></td>
+ <td colspan="5"><input type="checkbox" name="emailopts[0][2048]"<%- $checked[0][2048] %> value="1" /></td>
</tr>
<tr style="text-align: center">
- <td style="text-align: $stylevar[left]">{@"I am made the assignee"}</td>
- <td colspan="5"><input type="checkbox" name="emailopts[0][32]"{$checked[0][32]} value="1" /></td>
+ <td style="text-align: <%- $stylevar['left'] %>"><%-T("I am made the assignee")%></td>
+ <td colspan="5"><input type="checkbox" name="emailopts[0][32]"<%- $checked[0][32] %> value="1" /></td>
</tr>
<tr class="altcolor textcenter">
- <td style="text-align: $stylevar[left]">{@"Status or resolution changes"}</td>
- <td><input type="checkbox" name="emailopts[1][64]"{$checked[1][64]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[2][64]"{$checked[2][64]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[4][64]"{$checked[4][64]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[8][64]"{$checked[8][64]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[16][64]"{$checked[16][64]} value="1" /></td>
+ <td style="text-align: <%- $stylevar['left'] %>"><%-T("Status or resolution changes")%></td>
+ <td><input type="checkbox" name="emailopts[1][64]"<%- $checked[1][64] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[2][64]"<%- $checked[2][64] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[4][64]"<%- $checked[4][64] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[8][64]"<%- $checked[8][64] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[16][64]"<%- $checked[16][64] %> value="1" /></td>
</tr>
<tr style="text-align: center">
- <td style="text-align: $stylevar[left]">{@"'Duplicates' field is changed"}</td>
- <td><input type="checkbox" name="emailopts[1][128]"{$checked[1][128]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[2][128]"{$checked[2][128]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[4][128]"{$checked[4][128]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[8][128]"{$checked[8][128]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[16][128]"{$checked[16][128]} value="1" /></td>
+ <td style="text-align: <%- $stylevar['left'] %>"><%-T("'Duplicates' field is changed")%></td>
+ <td><input type="checkbox" name="emailopts[1][128]"<%- $checked[1][128] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[2][128]"<%- $checked[2][128] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[4][128]"<%- $checked[4][128] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[8][128]"<%- $checked[8][128] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[16][128]"<%- $checked[16][128] %> value="1" /></td>
</tr>
<tr class="altcolor textcenter">
- <td style="text-align: $stylevar[left]">{@"A new comment is added"}</td>
- <td><input type="checkbox" name="emailopts[1][256]"{$checked[1][256]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[2][256]"{$checked[2][256]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[4][256]"{$checked[4][256]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[8][256]"{$checked[8][256]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[16][256]"{$checked[16][256]} value="1" /></td>
+ <td style="text-align: <%- $stylevar['left'] %>"><%-T("A new comment is added")%></td>
+ <td><input type="checkbox" name="emailopts[1][256]"<%- $checked[1][256] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[2][256]"<%- $checked[2][256] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[4][256]"<%- $checked[4][256] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[8][256]"<%- $checked[8][256] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[16][256]"<%- $checked[16][256] %> value="1" /></td>
</tr>
<tr style="text-align: center">
- <td style="text-align: $stylevar[left]">{@"A new attachment is added"}</td>
- <td><input type="checkbox" name="emailopts[1][512]"{$checked[1][512]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[2][512]"{$checked[2][512]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[4][512]"{$checked[4][512]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[8][512]"{$checked[8][512]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[16][512]"{$checked[16][512]} value="1" /></td>
+ <td style="text-align: <%- $stylevar[left] %>"><%-T("A new attachment is added")%></td>
+ <td><input type="checkbox" name="emailopts[1][512]"<%- $checked[1][512] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[2][512]"<%- $checked[2][512] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[4][512]"<%- $checked[4][512] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[8][512]"<%- $checked[8][512] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[16][512]"<%- $checked[16][512] %> value="1" /></td>
</tr>
<tr class="altcolor textcenter">
- <td style="text-align: $stylevar[left]">{@"Any other field changes"}</td>
- <td><input type="checkbox" name="emailopts[1][1024]"{$checked[1][1024]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[2][1024]"{$checked[2][1024]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[4][1024]"{$checked[4][1024]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[8][1024]"{$checked[8][1024]} value="1" /></td>
- <td><input type="checkbox" name="emailopts[16][1024]"{$checked[16][1024]} value="1" /></td>
+ <td style="text-align: <%- $stylevar[left] %>"><%-T("Any other field changes")%></td>
+ <td><input type="checkbox" name="emailopts[1][1024]"<%- $checked[1][1024] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[2][1024]"<%- $checked[2][1024] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[4][1024]"<%- $checked[4][1024] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[8][1024]"<%- $checked[8][1024] %> value="1" /></td>
+ <td><input type="checkbox" name="emailopts[16][1024]"<%- $checked[16][1024] %> value="1" /></td>
</tr>
</table>
</div>
<br />
- <if condition="$searches">
+ <% if ($searches): %>
<!-- saved searches -->
<div class="box">
- <div class="box-head" style="text-align: $stylevar[left]">{@"Saved Searches"}</div>
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>"><%-T("Saved Searches")%></div>
<div class="box-mid">
- $searches
+ <%- $searches %>
</div>
</div>
<!-- / saved searches -->
- </if>
+ <% endif %>
</td>
<td>
- <if condition="$bugsys->options['authmethod'] == 'default'">
+ <% if (bugdar::$options['authmethod'] == 'default'): %>
<!-- password and email -->
<div class="box">
- <div class="box-head" style="text-align: $stylevar[left]">
- {@"Please enter your password to change these fields"}:
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>">
+ <%-T("Please enter your password to change these fields")%>:
<br />
<input type="password" name="validate" size="35" maxlength="250" />
<div class="box-mid box-margmod-top">
<fieldset>
- <legend>{@"Password"}</legend>
+ <legend><%-T("Password")%></legend>
<input type="password" name="password_change" size="25" style="width: 100%" maxlength="250" />
</fieldset>
<fieldset>
- <legend>{@"Confirm Password"}</legend>
+ <legend><%-T("Confirm Password")%></legend>
<input type="password" name="password_confirm" size="25" style="width: 100%" maxlength="250" />
</fieldset>
</div>
<div class="box-mid box-margmod-top">
<fieldset>
- <legend>{@"Email"}</legend>
- <input type="text" name="email_change" size="25" value="$email" style="width: 100%" maxlength="250" />
+ <legend><%-T("Email")%></legend>
+ <input type="text" name="email_change" size="25" value="<%- $email %>" style="width: 100%" maxlength="250" />
</fieldset>
<fieldset>
- <legend>{@"Confirm Email"}</legend>
- <input type="text" name="email_confirm" size="25" value="$email_confirm" style="width: 100%" maxlength="250" />
+ <legend><%-T("Confirm Email")%></legend>
+ <input type="text" name="email_confirm" size="25" value="<%- $email_confirm %>" style="width: 100%" maxlength="250" />
</fieldset>
</div>
</div>
<!-- / password and email -->
<br />
- </if>
+ <% endif %>
<!-- display options -->
<div class="box">
- <div class="box-head" style="text-align: $stylevar[left]">{@"Bug List Display Options"}</div>
+ <div class="box-head" style="text-align: <%- $stylevar['left'] %>"><%-T("Bug List Display Options")%></div>
<div class="box-mid">
<fieldset>
- <legend>{@"Hidden Statuses on Bug Listing"}</legend>
- <select name="hidestatuses[]" multiple="multiple" size="$hidestatusesnum">$hidestatuses</select>
+ <legend><%-T("Hidden Statuses on Bug Listing")%></legend>
+ <select name="hidestatuses[]" multiple="multiple" size="<%- $hidestatusesnum %>"><%- $hidestatuses %></select>
</fieldset>
<fieldset>
- <legend>{@"Default Sort Order Column"}</legend>
- $defaultsortkey
+ <legend><%-T("Default Sort Order Column")%></legend>
+ <%- $defaultsortkey %>
</fieldset>
<fieldset>
- <legend>{@"Default Sort Order Direction"}</legend>
- $defaultsortas
+ <legend><%-T("Default Sort Order Direction")%></legend>
+ <%- $defaultsortas %>
</fieldset>
<fieldset>
- <legend>{@"Bug List Columns"} $help[columnorder]</legend>
+ <legend><%-T("Bug List Columns")%> $help[columnorder]</legend>
<table class="table" style="width: auto">
- $columnOptions
+ <%- $columnOptions %>
</table>
</fieldset>
</div>
<br />
<div class="submitrow">
- <input name="submit" type="submit" value=" {@"Submit"} " accesskey="s" />
- <input name="reset" type="reset" value=" {@"Reset"} " accesskey="r" />
+ <input name="submit" type="submit" value=" <%-T("Submit")%> " accesskey="s" />
+ <input name="reset" type="reset" value=" <%-T("Reset")%> " accesskey="r" />
</div>
</form>
<tr>
- <td>$name:</td>
- <td><input type="text" size="2" maxlength="2" name="columnoptions[$column]" value="{$columns[$column]}" /></td>
+ <td><%- $name %>:</td>
+ <td><input type="text" size="2" maxlength="2" name="columnoptions[<%- $column %>]" value="<%- $columns[$column] %>" /></td>
</tr>
\ No newline at end of file
<div>
- <span style="float: $stylevar[right]">
- <a href="search.php?searchid=$search[searchid]&rerun=1">[{@"Run Search"}]</a>
- <a href="userctrl.php?do=deletesearch&searchid=$search[searchid]">[{@"Delete"}]</a>
+ <span style="float: <%- $stylevar['right'] %>">
+ <a href="search.php?searchid=<%- $search['searchid'] %>&rerun=1">[<%-T("Run Search")%>]</a>
+ <a href="userctrl.php?do=deletesearch&searchid=<%- $search['searchid'] %>">[<%-T("Delete")%>]</a>
</span>
- $search[name]
+ <%- $search['name'] %>
</div>
\ No newline at end of file
-<span title="<lang 1="$userinfo[userid]">{@"User ID: %1$s"}</lang>"><if condition="$userinfo['showemail']"><a href="mailto:$userinfo[email]">$userinfo[displayname]</a><else />$userinfo[displayname]</if></span>
\ No newline at end of file
+<span title="<%- sprintf(T('User ID: %1$s'), $userinfo['userid']) %>"><% if ($userinfo['showemail']): %><a href="mailto:<%- $userinfo['email'] %>"><%- $userinfo['displayname'] %></a><% else: %><%- $userinfo['displayname'] %><% endif %></span>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'userctrl_search'
);
-define('SVN', '$Id$');
$focus['user'] = 'focus';
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 (!$bugsys->userinfo['userid'])
+if (!bugdar::$userinfo['userid'])
{
$message->errorPermission();
}
-$userapi = new UserAPI($bugsys);
-$userapi->set('userid', $bugsys->userinfo['userid']);
-$userapi->set_condition();
+$userapi = new UserAPI();
+$userapi->set('userid', bugdar::$userinfo['userid']);
+$userapi->setCondition();
-$userinfo = $bugsys->userinfo;
+$userinfo = bugdar::$userinfo;
// ###################################################################
if ($_POST['do'] == 'killsearch')
{
- $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']);
+ $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']);
if (!$search)
{
$message->errorPermission();
}
- $db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->in['searchid']);
+ $db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->in['searchid']);
$message->redirect(T('This saved search has been removed from your list.'), 'userctrl.php');
}
if ($_REQUEST['do'] == 'deletesearch')
{
- $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']);
+ $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']);
if (!$search)
{
$message->errorPermission();
}
- $message->confirm(T('Are you sure you want to delete this saved search?'), 'userctrl.php', 'killsearch', T('Delete'), T('Cancel'), array('searchid' => $bugsys->in['searchid']));
+ $message->confirm(T('Are you sure you want to delete this saved search?'), 'userctrl.php', 'killsearch', T('Delete'), T('Cancel'), array('searchid' => $input->in['searchid']));
}
// ###################################################################
{
// -------------------------------------------------------------------
// authentication
- if (!empty($bugsys->in['password_change']) OR !empty($bugsys->in['email_change']))
+ if (!empty($input->in['password_change']) OR !empty($input->in['email_change']))
{
- if (empty($bugsys->in['validate']))
+ if (empty($input->in['validate']))
{
$message->addError(T('You need to enter your current password to change your email or password'));
}
else
{
- if (md5(md5($bugsys->in['validate']) . md5($bugsys->userinfo['salt'])) != $bugsys->userinfo['password'])
+ if (md5(md5($input->in['validate']) . md5(bugdar::$userinfo['salt'])) != bugdar::$userinfo['password'])
{
$message->addError(T('Your authentication password does not match the one in our records'));
}
// -------------------------------------------------------------------
// email validation
- if (!empty($bugsys->in['email_change']))
+ if (!empty($input->in['email_change']))
{
- if (!empty($bugsys->in['email_change']) AND empty($bugsys->in['email_confirm']))
+ if (!empty($input->in['email_change']) AND empty($input->in['email_confirm']))
{
$message->addError(T('You need to enter both the email and confirm email fields to change your address'));
}
- if ($bugsys->in['email_change'] != $bugsys->in['email_confirm'])
+ if ($input->in['email_change'] != $input->in['email_confirm'])
{
$message->addError(T('Your email and confirm email addresses do not match'));
}
- $userapi->set('email', $bugsys->in['email_change']);
+ $userapi->set('email', $input->in['email_change']);
}
// -------------------------------------------------------------------
// password validation
- if (!empty($bugsys->in['password_change']))
+ if (!empty($input->in['password_change']))
{
- if (!empty($bugsys->in['password_change']) AND empty($bugsys->in['password_confirm']))
+ if (!empty($input->in['password_change']) AND empty($input->in['password_confirm']))
{
$message->addError(T('You need to enter both the password and confirm password fields to change your password'));
}
else
{
- if ($bugsys->in['password_change'] != $bugsys->in['password_confirm'])
+ if ($input->in['password_change'] != $input->in['password_confirm'])
{
$message->addError(T('Your password and confirm password do not match'));
}
}
- $userapi->set('password', $bugsys->in['password_change']);
+ $userapi->set('password', $input->in['password_change']);
}
- $userapi->set('displayname', $bugsys->in['displayname']);
- $userapi->set('showemail', $bugsys->in['showemail']);
- $userapi->set('showcolors', $bugsys->in['showcolors']);
- $userapi->set('languageid', $bugsys->in['languageid']);
- $userapi->set('timezone', $bugsys->in['timezone']);
- $userapi->set('usedst', $bugsys->in['usedst']);
- $userapi->set('hidestatuses', $bugsys->in['hidestatuses']);
- $userapi->set('defaultsortkey', $bugsys->in['defaultsortkey']);
- $userapi->set('defaultsortas', $bugsys->in['defaultsortas']);
- $userapi->set('columnoptions', $bugsys->input_clean('columnoptions', TYPE_UINT));
+ $userapi->set('displayname', $input->in['displayname']);
+ $userapi->set('showemail', $input->in['showemail']);
+ $userapi->set('showcolors', $input->in['showcolors']);
+ $userapi->set('languageid', $input->in['languageid']);
+ $userapi->set('timezone', $input->in['timezone']);
+ $userapi->set('usedst', $input->in['usedst']);
+ $userapi->set('hidestatuses', $input->in['hidestatuses']);
+ $userapi->set('defaultsortkey', $input->in['defaultsortkey']);
+ $userapi->set('defaultsortas', $input->in['defaultsortas']);
+ $userapi->set('columnoptions', $input->inputClean('columnoptions', TYPE_UINT));
// -------------------------------------------------------------------
// copy fields
- $userinfo['displayname'] = $bugsys->in['displayname'];
- $userinfo['showemail'] = $bugsys->in['showemail'];
- $userinfo['showcolors'] = $bugsys->in['showcolors'];
- $userinfo['languageid'] = $bugsys->in['languageid'];
- $userinfo['timezone'] = $bugsys->in['timezone'];
- $userinfo['usedst'] = $bugsys->in['usedst'];
- $userinfo['hidestatuses'] = $bugsys->in['hidestatuses'];
- $userinfo['defaultsorkey'] = $bugsys->in['defaultsorkey'];
- $userinfo['defaultsortas'] = $bugsys->in['defaultsortas'];
- $userinfo['columnoptions'] = $bugsys->in['columnoptions'];
+ $userinfo['displayname'] = $input->in['displayname'];
+ $userinfo['showemail'] = $input->in['showemail'];
+ $userinfo['showcolors'] = $input->in['showcolors'];
+ $userinfo['languageid'] = $input->in['languageid'];
+ $userinfo['timezone'] = $input->in['timezone'];
+ $userinfo['usedst'] = $input->in['usedst'];
+ $userinfo['hidestatuses'] = $input->in['hidestatuses'];
+ $userinfo['defaultsorkey'] = $input->in['defaultsorkey'];
+ $userinfo['defaultsortas'] = $input->in['defaultsortas'];
+ $userinfo['columnoptions'] = $input->in['columnoptions'];
- $email = $bugsys->in['email_change'];
- $email_confirm = $bugsys->in['email_confirm'];
+ $email = $input->in['email_change'];
+ $email_confirm = $input->in['email_confirm'];
// -------------------------------------------------------------------
// error handling
{
$userapi->update();
- $db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $bugsys->userinfo['userid']);
- $bugsys->input_clean('emailopts', TYPE_INT);
- if (is_array($bugsys->in['emailopts']))
+ $db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . bugdar::$userinfo['userid']);
+ $input->inputClean('emailopts', TYPE_INT);
+ if (is_array($input->in['emailopts']))
{
- foreach ($bugsys->in['emailopts'] AS $relation => $bitarr)
+ foreach ($input->in['emailopts'] AS $relation => $bitarr)
{
$bitmask = 0;
if (is_array($bitarr))
$bitmask += $option * $yes;
}
}
- $db->query("INSERT INTO " . TABLE_PREFIX . "useremail (userid, relation, mask) VALUES (" . $bugsys->userinfo['userid'] . ", $relation, $bitmask)");
+ $db->query("INSERT INTO " . TABLE_PREFIX . "useremail (userid, relation, mask) VALUES (" . bugdar::$userinfo['userid'] . ", $relation, $bitmask)");
}
}
$langselect = construct_datastore_select('language', 'title', 'languageid', $userinfo['languageid']);
$hidestatuses = construct_datastore_select('status', 'status', 'statusid', (!is_array($userinfo['hidestatuses']) ? explode(',', $userinfo['hidestatuses']) : $userinfo['hidestatuses']), 0);
- $hidestatusesnum = (sizeof($bugsys->datastore['status']) < 8 ? sizeof($bugsys->datastore['status']) + 1 : 8);
+ $hidestatusesnum = (sizeof(bugdar::$datastore['status']) < 8 ? sizeof(bugdar::$datastore['status']) + 1 : 8);
$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();
- if (!is_array($bugsys->in['emailopts']))
+ if (!is_array($input->in['emailopts']))
{
- $options = $db->query("SELECT * FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $bugsys->userinfo['userid']);
- while ($opt = $db->fetch_array($options))
+ $options = $db->query("SELECT * FROM " . TABLE_PREFIX . "useremail WHERE userid = " . bugdar::$userinfo['userid']);
+ foreach ($options as $opt)
{
- foreach ($bugsys->emailoptions['notifications'] AS $name => $notif)
+ foreach (bugdar::$emailOptions['notifications'] AS $name => $notif)
{
- foreach ($bugsys->emailoptions['relations'] AS $name => $relation)
+ foreach (bugdar::$emailOptions['relations'] AS $name => $relation)
{
if ($opt['mask'] & $notif AND $opt['relation'] == $relation)
{
}
else
{
- $checked = $bugsys->in['emailopts'];
+ $checked = $input->in['emailopts'];
foreach ($checked AS $key1 => $value1)
{
foreach ($value1 AS $key2 => $value2)
$columns = array();
$columnOptions = '';
require_once('./includes/class_sort.php');
- if (!is_array($bugsys->in['columnoptions']))
+ if (!is_array($input->in['columnoptions']))
{
foreach (ListSorter::fetch_by_text(false) AS $column => $name)
{
- if (is_array($bugsys->userinfo['columnoptions']))
+ if (is_array(bugdar::$userinfo['columnoptions']))
{
- $columns["$column"] = $bugsys->userinfo['columnoptions']["$column"];
+ $columns["$column"] = bugdar::$userinfo['columnoptions']["$column"];
}
else
{
- $columns["$column"] = $bugsys->options['columnoptions']["$column"];
+ $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 = $bugsys->in['columnoptions'];
- foreach (ListSorter::fetch_by_text(false) AS $column => $name)
+ $columns = $input->in['columnoptions'];
+ 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();
}
}
// searches
$searches = '';
- $searchesFetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NOT NULL AND userid = " . $bugsys->userinfo['userid']);
- while ($search = $db->fetch_array($searchesFetch))
+ $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();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
ob_start();
-define('SVN', '$Id$');
$focus['showreport'] = 'focus';
require_once('./global.php');
-$attachment = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . $bugsys->input_clean('attachmentid', TYPE_UINT));
+$attachment = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . $input->inputClean('attachmentid', TYPE_UINT));
if (!$attachment)
{
$message->error(L_INVALID_ID);
}
-$bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $attachment[bugid]");
+$bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $attachment[bugid]");
if (!check_bug_permissions($bug))
{
$message->errorPermission();
ob_end_clean();
// only allow certain images to be displayed inline because all other types are a potential XSS issue waiting to happen
-if (in_array(strtolower($funct->fetch_extension($attachment['filename'])), array('jpg', 'jpeg', 'png', 'gif')))
+if (in_array(strtolower(BSFunctions::fetch_extension($attachment['filename'])), array('jpg', 'jpeg', 'png', 'gif')))
{
header("Content-Disposition: inline; filename=$attachment[filename]");
header("Content-transfer-encoding: binary");
print($attachment['attachment']);
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| ###################################################################
\*=====================================================================*/
-define('SVN', '$Id$');
$focus['showreport'] = 'focus';
if ($_REQUEST['do'] == 'vote')
{
- $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $bugsys->input_clean('bugid', TYPE_UINT));
- $vote = $db->query_first("SELECT *, FIND_IN_SET(" . $bugsys->userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]");
+ $bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $input->inputClean('bugid', TYPE_UINT));
+ $vote = $db->queryFirst("SELECT *, FIND_IN_SET(" . bugdar::$userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]");
if (!check_bug_permissions($bug))
{
// handle userids
$userids = $vote['userids'];
- if ($bugsys->userinfo['userid'])
+ if (bugdar::$userinfo['userid'])
{
if (trim($vote['userids']))
{
- $userids .= ',' . $bugsys->userinfo['userid'];
+ $userids .= ',' . bugdar::$userinfo['userid'];
}
else
{
- $userids = $bugsys->userinfo['userid'];
+ $userids = bugdar::$userinfo['userid'];
}
}
- $uservote = $bugsys->input_clean('vote', TYPE_INT);
+ $uservote = $input->inputClean('vote', TYPE_INT);
$votefor = $vote['votefor'];
$voteagainst = $vote['voteagainst'];
$message->redirect(T('Your vote has been added.'), "showreport.php?bugid=$bug[bugid]");
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file