From 4736ce33768728664268e3ff7a1478449a84d4ba Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 19 May 2013 21:06:34 -0400 Subject: [PATCH] Replace $bugsys->datastore with bugdar::$datastore --- admin/setting.php | 14 +++++------ admin/user.php | 8 +++--- admin/usergroup.php | 4 +-- explain.php | 12 ++++----- help.php | 4 +-- includes/functions.php | 42 ++++++++++++++++---------------- includes/functions_datastore.php | 30 +++++++++++------------ includes/functions_product.php | 14 +++++------ includes/init.php | 12 ++++----- includes/language.php | 8 +++--- install/global.php | 2 +- login.php | 2 +- newreport.php | 6 ++--- register.php | 8 +++--- search.php | 10 ++++---- showhistory.php | 4 +-- showreport.php | 32 ++++++++++++------------ syndicate.php | 6 ++--- userctrl.php | 2 +- 19 files changed, 110 insertions(+), 110 deletions(-) diff --git a/admin/setting.php b/admin/setting.php index 1b62679..98fc11d 100755 --- a/admin/setting.php +++ b/admin/setting.php @@ -132,7 +132,7 @@ if ($_REQUEST['do'] == 'modify') // 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'], $bugsys->options['defaultlanguage'], 'languageid', 'title'), $bugsys->options['defaultlanguage']); // syndicateditems $admin->row_span(T('Number of Syndicated Items'), 'thead'); @@ -154,23 +154,23 @@ if ($_REQUEST['do'] == 'modify') // 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'], $bugsys->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'], $bugsys->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'], $bugsys->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'], $bugsys->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 Not Selected.'), 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 Not Selected.'), construct_option_select('setting[defaultassign]', bugdar::$datastore['assignto'], $bugsys->options['defaultassign'], 'userid', 'displayname', 0)); // defaultcomment $admin->row_span(T('Default Comment Text'), 'thead'); @@ -184,7 +184,7 @@ if ($_REQUEST['do'] == 'modify') // 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'], $bugsys->options['hidestatuses'], 'statusid', 'status', 0, true)); // defaultsortkey $admin->row_span(T('Default Sort Column'), 'thead'); diff --git a/admin/user.php b/admin/user.php index 578c485..a7d5606 100644 --- a/admin/user.php +++ b/admin/user.php @@ -196,14 +196,14 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') $admin->row_input(T('Email'), 'email', $user->objdata['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->row_list(T('Primary Usergroup'), 'usergroupid'); $ids = explode(',', $user->objdata['groupids']); - foreach ($bugsys->datastore['usergroup'] AS $id => $group) + foreach (bugdar::$datastore['usergroup'] AS $id => $group) { if ($id == $user->objdata['usergroupid']) { @@ -216,7 +216,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') $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']); - foreach ($bugsys->datastore['language'] AS $language) + foreach (bugdar::$datastore['language'] AS $language) { $admin->list_item($language['title'], $language['languageid'], ($user->objdata['languageid'] == $language['languageid'])); } @@ -229,7 +229,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') $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('Hidden Statuses on Bug Listing'), construct_option_select('hidestatuses', bugdar::$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'])); diff --git a/admin/usergroup.php b/admin/usergroup.php index 074f316..bbb43d2 100755 --- a/admin/usergroup.php +++ b/admin/usergroup.php @@ -334,7 +334,7 @@ if ($_POST['do'] == 'doapprove') $users = $db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid IN (" . implode(',', $idlist) . ")"); while ($user = $db->fetch_array($users)) { - $tpl = $template->fetch(FetchEmailPath('accountapproved.xml', $bugsys->datastore['language'][$bugsys->options['defaultlanguage']]['langcode'])); + $tpl = $template->fetch(FetchEmailPath('accountapproved.xml', bugdar::$datastore['language'][$bugsys->options['defaultlanguage']]['langcode'])); eval('$email = "' . $tpl . '";'); $email = $bugsys->xml->parse($email); $mail->setSubject($email['email']['subject']['value']); @@ -368,7 +368,7 @@ if ($_REQUEST['do'] == 'approve') { $admin->row_multi_item(array( '' . $user['email'] . '' => 'l', - $bugsys->datastore['usergroup']["$user[usergroupid]"]['title'] => 'c', + bugdar::$datastore['usergroup']["$user[usergroupid]"]['title'] => 'c', '' => 'c' )); } diff --git a/explain.php b/explain.php index 73bba96..9e2b20b 100644 --- a/explain.php +++ b/explain.php @@ -41,12 +41,12 @@ if (empty($_REQUEST['do'])) 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']) { @@ -58,7 +58,7 @@ if ($_REQUEST['do'] == 'products') } } - foreach ($bugsys->datastore['version'] AS $version) + foreach (bugdar::$datastore['version'] AS $version) { $versions["$version[productid]"]["$version[versionid]"] = $version; } @@ -114,9 +114,9 @@ if ($_REQUEST['do'] == 'automations') $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']); @@ -142,7 +142,7 @@ if ($_REQUEST['do'] == 'automations') foreach ($automation['fieldchanges']['builtin'] AS $name => $value) { $left = $name; - $right = $bugsys->datastore["$left"]["$value"]["$left"]; + $right = bugdar::$datastore["$left"]["$value"]["$left"]; eval('$automations .= "' . $template->fetch('explain_row') . '";'); } } diff --git a/help.php b/help.php index 3097ea4..044a003 100644 --- a/help.php +++ b/help.php @@ -26,14 +26,14 @@ $fetchtemplates = array( require_once('./global.php'); -if (!$bugsys->in['topic'] OR !isset($bugsys->datastore['help'][ $bugsys->in['topic'] ])) +if (!$bugsys->in['topic'] OR !isset(bugdar::$datastore['help'][ $bugsys->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'][ $bugsys->in['topic'] ]; $topic['body'] = nl2br($topic['body']); } diff --git a/includes/functions.php b/includes/functions.php index 53ac814..304bf85 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -114,7 +114,7 @@ function can_perform($bitmask, $productid = 0, $userinfo = null) $userinfo =& $bugsys->userinfo; } - $permissions =& $bugsys->datastore['permission']; + $permissions =& bugdar::$datastore['permission']; if (!isset($bugsys->permissions["$bitmask"])) { @@ -188,7 +188,7 @@ function construct_datastore_select($datastore, $labelname, $valuename, $selecte } } - foreach ($bugsys->datastore["$datastore"] AS $item) + foreach (bugdar::$datastore["$datastore"] AS $item) { $label = $item["$labelname"]; $value = $item["$valuename"]; @@ -485,14 +485,14 @@ function fetch_on_bits($mask, $userinfo = null) $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'] & $bugsys->permissions["$mask"]) { - foreach ($bugsys->datastore['product'] AS $id => $product) + foreach (bugdar::$datastore['product'] AS $id => $product) { $onbits["$id"] = $id; } @@ -506,9 +506,9 @@ function fetch_on_bits($mask, $userinfo = null) // 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"]) { @@ -552,7 +552,7 @@ function fetch_help_link($topic) { global $bugsys; - if (isset($bugsys->datastore['help']["$topic"])) + if (isset(bugdar::$datastore['help']["$topic"])) { eval('$temp = "' . $bugsys->template->fetch('help_link') . '";'); return $temp; @@ -592,8 +592,8 @@ function fetch_guest_user() 'email' => '', 'displayname' => '', 'showcolors' => 1, - 'permissions' => $bugsys->datastore['usergroup'][1]['permissions'], - 'displaytitle' => $bugsys->datastore['usergroup'][1]['displaytitle'], + 'permissions' => bugdar::$datastore['usergroup'][1]['permissions'], + 'displaytitle' => bugdar::$datastore['usergroup'][1]['displaytitle'], 'timezone' => $bugsys->options['defaulttimezone'] ); } @@ -677,15 +677,15 @@ function ProcessBugDataForDisplay($bug, $color = '') $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['bgcolor'] = ($bugsys->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']); @@ -771,7 +771,7 @@ 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']); @@ -780,7 +780,7 @@ function FetchUserPermissions(&$user) foreach ($user['groupids'] AS $group) { - $perms |= (int)$bugsys->datastore['usergroup']["$group"]['permissions']; + $perms |= (int)bugdar::$datastore['usergroup']["$group"]['permissions']; } return $perms; diff --git a/includes/functions_datastore.php b/includes/functions_datastore.php index 1e488f4..74ca7b3 100755 --- a/includes/functions_datastore.php +++ b/includes/functions_datastore.php @@ -36,7 +36,7 @@ function build_languages() VALUES ('language', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['language'] = $tempstore; + bugdar::$datastore['language'] = $tempstore; } // ####################### Start build_settings ###################### @@ -56,7 +56,7 @@ function build_settings() VALUES ('setting', '" . $bugsys->escape(serialize($options)) . "')" ); - $bugsys->datastore['setting'] = $options; + bugdar::$datastore['setting'] = $options; } // ###################### Start build_usergroups ##################### @@ -76,7 +76,7 @@ function build_usergroups() VALUES ('usergroup', '" . $bugsys->escape(serialize($groups)) . "')" ); - $bugsys->datastore['usergroup'] = $groups; + bugdar::$datastore['usergroup'] = $groups; } // ####################### Start build_statuses ###################### @@ -96,7 +96,7 @@ function build_statuses() VALUES ('status', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['status'] = $tempstore; + bugdar::$datastore['status'] = $tempstore; } // ###################### Start build_severities ##################### @@ -116,7 +116,7 @@ function build_severities() VALUES ('severity', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['severity'] = $tempstore; + bugdar::$datastore['severity'] = $tempstore; } // ###################### Start build_priorities ##################### @@ -136,7 +136,7 @@ function build_priorities() VALUES ('priority', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['priority'] = $tempstore; + bugdar::$datastore['priority'] = $tempstore; } // ###################### Start build_assignedto ##################### @@ -146,7 +146,7 @@ function build_assignedto() // 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']) { @@ -173,7 +173,7 @@ function build_assignedto() VALUES ('assignto', '" . $bugsys->escape(serialize($devs)) . "')" ); - $bugsys->datastore['assignto'] = $devs; + bugdar::$datastore['assignto'] = $devs; } // ##################### Start build_resolutions ##################### @@ -193,7 +193,7 @@ function build_resolutions() VALUES ('resolution', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['resolution'] = $tempstore; + bugdar::$datastore['resolution'] = $tempstore; } // ####################### Start build_versions ###################### @@ -213,7 +213,7 @@ function build_versions() VALUES ('version', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['version'] = $tempstore; + bugdar::$datastore['version'] = $tempstore; } // ####################### Start build_products ###################### @@ -242,8 +242,8 @@ function build_products() ('component', '" . $bugsys->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 ##################### @@ -263,7 +263,7 @@ function build_permissions() VALUES ('permission', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['permission'] = $tempstore; + bugdar::$datastore['permission'] = $tempstore; } // ##################### Start build_automations #################### @@ -283,7 +283,7 @@ function build_automations() VALUES ('automation', '" . $bugsys->escape(serialize($actions)) . "')" ); - $bugsys->datastore['automation'] = $actions; + bugdar::$datastore['automation'] = $actions; } // ###################### Start build_user_help ###################### @@ -311,6 +311,6 @@ function build_user_help() VALUES ('help', '" . $bugsys->escape(serialize($help)) . "')" ); - $bugsys->datastore['help'] = $help; + bugdar::$datastore['help'] = $help; } diff --git a/includes/functions_product.php b/includes/functions_product.php index 06c5dcc..3779ea4 100644 --- a/includes/functions_product.php +++ b/includes/functions_product.php @@ -40,16 +40,16 @@ function ConstructProductSelect($action = 'canviewbugs', $select = null, $obsole // 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'])) { @@ -90,7 +90,7 @@ function ConstructVersionSelect($productid, $select, $obsolete) { global $bugsys; - $product = $bugsys->datastore['product']["$productid"]; + $product = bugdar::$datastore['product']["$productid"]; $component = null; $build = ''; @@ -98,11 +98,11 @@ function ConstructVersionSelect($productid, $select, $obsolete) // 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))) { diff --git a/includes/init.php b/includes/init.php index b1818b1..82acf50 100755 --- a/includes/init.php +++ b/includes/init.php @@ -76,7 +76,7 @@ require_once('./includes/language.php'); // init the big three $bugsys->options = array(); $bugsys->userinfo = array(); -$bugsys->datastore = array(); +bugdar::$datastore = array(); class bugdar { @@ -131,12 +131,12 @@ if (!$datastoretemp) while ($store = $db->fetch_array($datastoretemp)) { - $bugsys->datastore["$store[title]"] = unserialize($store['data']); + bugdar::$datastore["$store[title]"] = unserialize($store['data']); } -bugdar::$datastore = $bugsys->datastore; -$bugsys->options = $bugsys->datastore['setting']; + +$bugsys->options = bugdar::$datastore['setting']; $bugsys->options['columnoptions'] = unserialize($bugsys->options['columnoptions']); -unset($bugsys->datastore['setting']); +unset(bugdar::$datastore['setting']); bugdar::$options = $bugsys->options; $bugsys->setAppVersion($bugsys->options['trackerversion']); @@ -159,7 +159,7 @@ 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['displaytitle'] = bugdar::$datastore['usergroup'][ $bugsys->userinfo['usergroupid'] ]['displaytitle']; $bugsys->userinfo['columnoptions'] = unserialize($bugsys->userinfo['columnoptions']); } else diff --git a/includes/language.php b/includes/language.php index af4e252..da95352 100644 --- a/includes/language.php +++ b/includes/language.php @@ -47,17 +47,17 @@ function fetch_user_language() if ($bugsys->userinfo['userid']) { $languageid = $bugsys->userinfo['languageid']; - $language = $bugsys->datastore['language']["$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']) { $languageid = $language['languageid']; - $language = $bugsys->datastore['language']["$languageid"]; + $language = bugdar::$datastore['language']["$languageid"]; break; } } diff --git a/install/global.php b/install/global.php index b5c4acf..e7d9e7d 100644 --- a/install/global.php +++ b/install/global.php @@ -78,7 +78,7 @@ require_once('./includes/permissions.php'); $bugsys->options = array(); $bugsys->userinfo = array(); -$bugsys->datastore = array(); +bugdar::$datastore = array(); // ################################################################### diff --git a/login.php b/login.php index e566738..92f9f5d 100755 --- a/login.php +++ b/login.php @@ -120,7 +120,7 @@ if ($_POST['do'] == 'sendpw') $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'])) . '";'); + eval('$email = "' . $template->fetch(FetchEmailPath('passwordreset.xml', bugdar::$datastore['language'][$user->objdata['languageid']]['langcode'])) . '";'); $email = $bugsys->xml->parse($email); $mail->setSubject($email['email']['subject']['value']); diff --git a/newreport.php b/newreport.php index 2129158..72e193f 100755 --- a/newreport.php +++ b/newreport.php @@ -138,11 +138,11 @@ if ($_POST['do'] == 'insert') 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.')); } @@ -162,7 +162,7 @@ if ($_REQUEST['do'] == 'add') 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); diff --git a/register.php b/register.php index 5448a10..84e17c8 100755 --- a/register.php +++ b/register.php @@ -95,7 +95,7 @@ if ($_POST['do'] == 'insert') $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'])) . '";'); + eval('$email = "' . $template->fetch(FetchEmailPath('activateaccount.xml', bugdar::$datastore['language'][$bugsys->in['languageid']]['langcode'])) . '";'); $email = $bugsys->xml->parse($email); $mail->setSubject($email['email']['subject']['value']); $mail->setBodyText($email['email']['bodyText']['value']); @@ -109,7 +109,7 @@ if ($_POST['do'] == 'insert') if ($bugsys->options['sendwelcomemail']) { $displayName = $bugsys->in['displayname']; - eval('$email = "' . $template->fetch(FetchEmailPath('welcome.xml', $bugsys->datastore['language'][$bugsys->in['languageid']]['langcode'])) . '";'); + eval('$email = "' . $template->fetch(FetchEmailPath('welcome.xml', bugdar::$datastore['language'][$bugsys->in['languageid']]['langcode'])) . '";'); $email = $bugsys->xml->parse($email); $mail->setSubject($email['email']['subject']['value']); $mail->setBodyText($email['email']['bodyText']['value']); @@ -147,7 +147,7 @@ if (empty($_REQUEST['do'])) $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']); @@ -171,7 +171,7 @@ if ($_REQUEST['do'] == 'activate') if ($bugsys->options['sendwelcomemail']) { $displayName = $user['displayname']; - eval('$email = "' . $template->fetch(FetchEmailPath('welcome.xml', $bugsys->datastore['language'][$user['languageid']]['langcode'])) . '";'); + eval('$email = "' . $template->fetch(FetchEmailPath('welcome.xml', bugdar::$datastore['language'][$user['languageid']]['langcode'])) . '";'); $email = $bugsys->xml->parse($email); $mail->setSubject($email['email']['subject']['value']); $mail->setBodyText($email['email']['bodyText']['value']); diff --git a/search.php b/search.php index d0469be..4c71934 100644 --- a/search.php +++ b/search.php @@ -108,12 +108,12 @@ if ($_REQUEST['do'] == 'search') 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.')); } @@ -157,7 +157,7 @@ if ($_REQUEST['do'] == 'search') } $select['dev'] = ''; - foreach ($bugsys->datastore['assignto'] AS $dev) + foreach (bugdar::$datastore['assignto'] AS $dev) { $value = $dev['userid']; $label = construct_user_display($dev, false); @@ -481,7 +481,7 @@ if ($_REQUEST['do'] == 'update') $selected = true; eval('$select[dev] .= "' . $template->fetch('selectoption') . '";'); $selected = false; - foreach ($bugsys->datastore['assignto'] AS $dev) + foreach (bugdar::$datastore['assignto'] AS $dev) { $value = $dev['userid']; $label = construct_user_display($dev, false); @@ -618,7 +618,7 @@ if ($_REQUEST['do'] == 'export') $xml .= "\n\t\t" . $bug['status'] . ""; if ($bug['assignedto']) { - $xml .= "\n\t\t" . construct_user_display($bugsys->datastore['assignto']["$bug[assignedto]"], false) . ""; + $xml .= "\n\t\t" . construct_user_display(bugdar::$datastore['assignto']["$bug[assignedto]"], false) . ""; } $xml .= "\n\t\t" . $bug['resolution'] . ""; $xml .= "\n\t\t" . $bug['severity'] . ""; diff --git a/showhistory.php b/showhistory.php index 345a4ef..d46bc87 100644 --- a/showhistory.php +++ b/showhistory.php @@ -132,8 +132,8 @@ foreach ($logs AS $dateline => $logitems) 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') { diff --git a/showreport.php b/showreport.php index add67d5..49f9491 100644 --- a/showreport.php +++ b/showreport.php @@ -96,16 +96,16 @@ if ($show['edit']) } 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'])) + if (can_perform('canassign', $bug['product']) AND 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); @@ -134,9 +134,9 @@ if ($show['edit']) $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']; @@ -160,12 +160,12 @@ else { // ------------------------------------------------------------------- // 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]"); @@ -201,11 +201,11 @@ $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['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 diff --git a/syndicate.php b/syndicate.php index a54dd70..cd9ff6f 100644 --- a/syndicate.php +++ b/syndicate.php @@ -68,15 +68,15 @@ while ($bug = $db->fetch_array($bugs_fetch)) ' . T('Product/Component/Version') . ': - ' . $bugsys->datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? $bugsys->datastore['product']["$bug[component]"]['title'] . '/' : '') . $bugsys->datastore['version']["$bug[version]"]['version'] . ' + ' . bugdar::$datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? bugdar::$datastore['product']["$bug[component]"]['title'] . '/' : '') . bugdar::$datastore['version']["$bug[version]"]['version'] . ' ' . T('Status') . ': - ' . $bugsys->datastore['status']["$bug[status]"]['status'] . ' + ' . bugdar::$datastore['status']["$bug[status]"]['status'] . ' ' . T('Severity') . ': - ' . $bugsys->datastore['severity']["$bug[severity]"]['severity'] . ' + ' . bugdar::$datastore['severity']["$bug[severity]"]['severity'] . '

' . $bug['comment_parsed'] . '

') . ' diff --git a/userctrl.php b/userctrl.php index 61266dc..a6cb70d 100644 --- a/userctrl.php +++ b/userctrl.php @@ -204,7 +204,7 @@ if ($_REQUEST['do'] == 'modify') $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']); -- 2.43.5