From 03a971f2b2bf443c90ad097691461bf74ba50b72 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 23 Aug 2008 10:34:39 -0400 Subject: [PATCH] Replace *API($bugsys) with API() --- admin/automation.php | 6 +++--- admin/field.php | 6 +++--- admin/language.php | 8 ++++---- admin/priority.php | 8 ++++---- admin/resolution.php | 8 ++++---- admin/severity.php | 8 ++++---- admin/status.php | 8 ++++---- admin/user.php | 8 ++++---- admin/usergroup.php | 8 ++++---- admin/userhelp.php | 6 +++--- attachment.php | 6 +++--- docs/populate.php | 6 +++--- docs/post-commit.php | 2 +- editcomment.php | 4 ++-- editreport.php | 4 ++-- install/install.php | 2 +- login.php | 4 ++-- newreport.php | 6 +++--- register.php | 2 +- userctrl.php | 2 +- 20 files changed, 56 insertions(+), 56 deletions(-) diff --git a/admin/automation.php b/admin/automation.php index 0756350..99e4d07 100644 --- a/admin/automation.php +++ b/admin/automation.php @@ -44,7 +44,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'kill') { - $action = new AutomationAPI($bugsys); + $action = new AutomationAPI(); $action->set('actionid', $input->in['actionid']); $action->set_condition(); $action->delete(); @@ -87,7 +87,7 @@ if ($_POST['do'] == 'insert' OR $_POST['do'] == 'update') } } - $action = new AutomationAPI($bugsys); + $action = new AutomationAPI(); $action->set('name', $input->in['name']); $action->set('description', $input->in['description']); $action->set('fieldchanges', $deltas); @@ -121,7 +121,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit') NavLinks::automationsEdit($input->in['actionid']); $navigator->set_focus('link', 'fields-pages-automations', 'fields-pages'); - $action = new AutomationAPI($bugsys); + $action = new AutomationAPI(); $action->set('actionid', $input->in['actionid']); $action->set_condition(); $action->fetch(); diff --git a/admin/field.php b/admin/field.php index 2d5f8f3..d903c0e 100644 --- a/admin/field.php +++ b/admin/field.php @@ -44,7 +44,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'kill') { - $field = new FieldAPI($bugsys); + $field = new FieldAPI(); $field->set('fieldid', $input->in['fieldid']); $field->set_condition(); $field->delete(); @@ -68,7 +68,7 @@ if ($_REQUEST['do'] == 'update') $type = $input->in['type']; - $field = new FieldAPI($bugsys); + $field = new FieldAPI(); if ($input->in['fieldid']) { @@ -142,7 +142,7 @@ if ($_REQUEST['do'] == 'update') 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($input->in['step'])) ? true : false); diff --git a/admin/language.php b/admin/language.php index 412e269..9d945ec 100644 --- a/admin/language.php +++ b/admin/language.php @@ -44,7 +44,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'kill') { - $language = new LanguageAPI($bugsys); + $language = new LanguageAPI(); $language->set('languageid', $input->in['languageid']); $language->set_condition(); $language->delete(); @@ -63,7 +63,7 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'insert') { - $language = new LanguageAPI($bugsys); + $language = new LanguageAPI(); $language->set('title', $input->in['title']); $language->set('charset', $input->in['charset']); $language->set('direction', $input->in['direction']); @@ -106,7 +106,7 @@ if ($_REQUEST['do'] == 'add') if ($_POST['do'] == 'update') { - $language = new LanguageAPI($bugsys); + $language = new LanguageAPI(); $language->set('languageid', $input->in['languageid']); $language->set_condition(); $language->set('title', $input->in['title']); @@ -126,7 +126,7 @@ if ($_REQUEST['do'] == 'edit') NavLinks::languagesEdit($input->in['languageid']); $navigator->set_focus('link', 'options-languages-edit', 'options-languages'); - $languageapi = new LanguageAPI($bugsys); + $languageapi = new LanguageAPI(); $languageapi->set('languageid', $input->in['languageid']); $languageapi->set_condition(); $languageapi->fetch(); diff --git a/admin/priority.php b/admin/priority.php index c4ca270..5439bf8 100755 --- a/admin/priority.php +++ b/admin/priority.php @@ -44,7 +44,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'kill') { - $priority = new PriorityAPI($bugsys); + $priority = new PriorityAPI(); $priority->set('priorityid', $input->in['priorityid']); $priority->set_condition(); $priority->delete(); @@ -63,7 +63,7 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'insert') { - $priority = new PriorityAPI($bugsys); + $priority = new PriorityAPI(); $priority->set('priority', $input->in['priority']); $priority->set('displayorder', $input->in['displayorder']); $priority->insert(); @@ -96,7 +96,7 @@ if ($_REQUEST['do'] == 'add') if ($_POST['do'] == 'update') { - $priority = new PriorityAPI($bugsys); + $priority = new PriorityAPI(); $priority->set('priorityid', $input->in['priorityid']); $priority->set_condition(); $priority->set('priority', $input->in['priority']); @@ -113,7 +113,7 @@ if ($_REQUEST['do'] == 'edit') NavLinks::prioritiesEdit($input->in['priorityid']); $navigator->set_focus('link', 'fields-pages-priorities', 'fields-pages'); - $priority = new PriorityAPI($bugsys); + $priority = new PriorityAPI(); $priority->set('priorityid', $input->in['priorityid']); $priority->set_condition(); $priority->fetch(); diff --git a/admin/resolution.php b/admin/resolution.php index 1ba5ee5..f616a2a 100755 --- a/admin/resolution.php +++ b/admin/resolution.php @@ -44,7 +44,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'kill') { - $resolution = new ResolutionAPI($bugsys); + $resolution = new ResolutionAPI(); $resolution->set('resolutionid', $input->in['resolutionid']); $resolution->set_condition(); $resolution->delete(); @@ -63,7 +63,7 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'insert') { - $resolution = new ResolutionAPI($bugsys); + $resolution = new ResolutionAPI(); $resolution->set('resolution', $input->in['resolution']); $resolution->set('displayorder', $input->in['displayorder']); $resolution->insert(); @@ -96,7 +96,7 @@ if ($_REQUEST['do'] == 'add') if ($_POST['do'] == 'update') { - $resolution = new ResolutionAPI($bugsys); + $resolution = new ResolutionAPI(); $resolution->set('resolutionid', $input->in['resolutionid']); $resolution->set_condition(); $resolution->set('resolution', $input->in['resolution']); @@ -113,7 +113,7 @@ if ($_REQUEST['do'] == 'edit') NavLinks::resolutionsEdit($input->in['resolutionid']); $navigator->set_focus('link', 'fields-pages-resolutions', 'fields-pages'); - $resolution = new ResolutionAPI($bugsys); + $resolution = new ResolutionAPI(); $resolution->set('resolutionid', $input->in['resolutionid']); $resolution->set_condition(); $resolution->fetch(); diff --git a/admin/severity.php b/admin/severity.php index 6e80b36..390771d 100755 --- a/admin/severity.php +++ b/admin/severity.php @@ -44,7 +44,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'kill') { - $severity = new SeverityAPI($bugsys); + $severity = new SeverityAPI(); $severity->set('severityid', $input->in['severityid']); $severity->set_condition(); $severity->delete(); @@ -63,7 +63,7 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'insert') { - $severity = new SeverityAPI($bugsys); + $severity = new SeverityAPI(); $severity->set('severity', $input->in['severity']); $severity->set('displayorder', $input->in['displayorder']); $severity->insert(); @@ -96,7 +96,7 @@ if ($_REQUEST['do'] == 'add') if ($_POST['do'] == 'update') { - $severity = new SeverityAPI($bugsys); + $severity = new SeverityAPI(); $severity->set('severityid', $input->in['severityid']); $severity->set_condition(); $severity->set('severity', $input->in['severity']); @@ -113,7 +113,7 @@ if ($_REQUEST['do'] == 'edit') NavLinks::severitiesEdit($input->in['severityid']); $navigator->set_focus('link', 'fields-pages-severities', 'fields-pages'); - $severity = new SeverityAPI($bugsys); + $severity = new SeverityAPI(); $severity->set('severityid', $input->in['severityid']); $severity->set_condition(); $severity->fetch(); diff --git a/admin/status.php b/admin/status.php index 77056e2..f2c07c8 100755 --- a/admin/status.php +++ b/admin/status.php @@ -44,7 +44,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'kill') { - $status = new StatusAPI($bugsys); + $status = new StatusAPI(); $status->set('statusid', $input->in['statusid']); $status->set_condition(); $status->delete(); @@ -63,7 +63,7 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'insert') { - $status = new StatusAPI($bugsys); + $status = new StatusAPI(); $status->set('status', $input->in['status']); $status->set('color', $input->in['color']); $status->set('displayorder', $input->in['displayorder']); @@ -98,7 +98,7 @@ if ($_REQUEST['do'] == 'add') if ($_POST['do'] == 'update') { - $status = new StatusAPI($bugsys); + $status = new StatusAPI(); $status->set('statusid', $input->in['statusid']); $status->set_condition(); $status->set('status', $input->in['status']); @@ -116,7 +116,7 @@ if ($_REQUEST['do'] == 'edit') NavLinks::statusesEdit($input->in['statusid']); $navigator->set_focus('link', 'fields-pages-statuses', 'fields-pages'); - $status = new StatusAPI($bugsys); + $status = new StatusAPI(); $status->set('statusid', $input->in['statusid']); $status->set_condition(); $status->fetch(); diff --git a/admin/user.php b/admin/user.php index f715a95..0040f4b 100644 --- a/admin/user.php +++ b/admin/user.php @@ -61,7 +61,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'kill') { - $user = new UserAPI($bugsys); + $user = new UserAPI(); $user->set('userid', $input->in['userid']); $user->set_condition(); $user->delete(); @@ -80,7 +80,7 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'insert') { - $user = new UserAPI($bugsys); + $user = new UserAPI(); $user->set('displayname', $input->in['displayname']); $user->set('email', $input->in['email']); $user->set('showemail', $input->in['showemail']); @@ -120,7 +120,7 @@ if ($_POST['do'] == 'insert') if ($_POST['do'] == 'update') { - $user = new UserAPI($bugsys); + $user = new UserAPI(); $user->set('userid', $input->in['userid']); $user->set_condition(); $user->set('displayname', $input->in['displayname']); @@ -168,7 +168,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') NavLinks::usersEdit($input->in['userid']); $navigator->set_focus('link', 'users-pages-users', 'users-pages'); - $user = new UserAPI($bugsys); + $user = new UserAPI(); $user->set('userid', $input->in['userid']); $user->set_condition(); $user->fetch(); diff --git a/admin/usergroup.php b/admin/usergroup.php index 70b5242..e0b7cfe 100755 --- a/admin/usergroup.php +++ b/admin/usergroup.php @@ -87,7 +87,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'kill') { - $usergroup = new UsergroupAPI($bugsys); + $usergroup = new UsergroupAPI(); $usergroup->set('usergroupid', $input->in['usergroupid']); $usergroup->set_condition(); $usergroup->delete(); @@ -132,7 +132,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == if ($edit OR $clone) { - $usergroup = new UsergroupAPI($bugsys); + $usergroup = new UsergroupAPI(); $usergroup->set('usergroupid', $input->in['usergroupid']); $usergroup->set_condition(); $usergroup->fetch(); @@ -219,7 +219,7 @@ if ($_POST['do'] == 'insert') $permissionvalue += $bugsys->permissions["$permtitle"] * $binaryswitch; } - $usergroup = new UsergroupAPI($bugsys); + $usergroup = new UsergroupAPI(); $usergroup->set('title', $input->in['title']); $usergroup->set('displaytitle', $input->in['displaytitle']); $usergroup->set('permissions', $permissionvalue); @@ -274,7 +274,7 @@ if ($_POST['do'] == 'update') $permissionvalue += $bugsys->permissions["$permtitle"] * $binaryswitch; } - $usergroup = new UsergroupAPI($bugsys); + $usergroup = new UsergroupAPI(); $usergroup->set('usergroupid', $input->in['usergroupid']); $usergroup->set_condition(); $usergroup->set('title', $input->in['title']); diff --git a/admin/userhelp.php b/admin/userhelp.php index 4b227ce..8de6652 100755 --- a/admin/userhelp.php +++ b/admin/userhelp.php @@ -46,7 +46,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'kill') { - $help = new UserHelpAPI($bugsys); + $help = new UserHelpAPI(); $help->set('keystring', $input->in['keystring']); $help->delete(); @@ -66,7 +66,7 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'insert') { - $help = new UserHelpAPI($bugsys); + $help = new UserHelpAPI(); $help->set('keystring', $input->in['keystring']); $help->set('title', $input->in['title']); $help->set('body', $input->in['body']); @@ -107,7 +107,7 @@ if ($_POST['do'] == 'update') { 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(); diff --git a/attachment.php b/attachment.php index 2ccac17..e6e506c 100755 --- a/attachment.php +++ b/attachment.php @@ -65,7 +65,7 @@ $notif->set_bug_data($bug); if ($_POST['do'] == 'insert') { - $attachapi = new AttachmentAPI($bugsys); + $attachapi = new AttachmentAPI(); $attachapi->set('bugid', $input->in['bugid']); if (!can_perform('canputattach', $bug['product'])) @@ -139,7 +139,7 @@ if ($_POST['do'] == 'insert') // handle comment stuff if (can_perform('canpostcomments', $bug['product']) AND trim($input->in['comment'])) { - $comment = new CommentAPI($bugsys); + $comment = new CommentAPI(); $comment->set('bugid', $input->in['bugid']); $comment->set('userid', bugdar::$userinfo['userid']); $comment->set('comment', $input->in['comment']); @@ -197,7 +197,7 @@ if ($_POST['do'] == 'update') $message->errorPermission(); } - $attachapi = new AttachmentAPI($bugsys); + $attachapi = new AttachmentAPI(); $attachapi->set('attachmentid', $input->in['attachmentid']); $attachapi->dorelations = array(); $attachapi->set_condition(); diff --git a/docs/populate.php b/docs/populate.php index 50042a2..00b5f50 100644 --- a/docs/populate.php +++ b/docs/populate.php @@ -6,8 +6,8 @@ include 'includes/api_comment.php'; for ($i = 11; $i < 111; $i++) { - $bug = new BugAPI($bugsys); - $comment = new CommentAPI($bugsys); + $bug = new BugAPI(); + $comment = new CommentAPI(); $bug->set('userid', bugdar::$userinfo['userid']); $bug->set('username', bugdar::$userinfo['displayname']); @@ -31,7 +31,7 @@ for ($i = 11; $i < 111; $i++) $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(); diff --git a/docs/post-commit.php b/docs/post-commit.php index edc346b..bae28b1 100755 --- a/docs/post-commit.php +++ b/docs/post-commit.php @@ -53,7 +53,7 @@ if (preg_match_all('#(fixe(s|d)|close(s|d)) bug://(report/)?([0-9]*)#i', $output foreach ($matches[5] AS $id) { - $api = new BugAPI($bugsys); + $api = new BugAPI(); $api->set('bugid', $id); $api->set_condition(); $api->set('status', 4); diff --git a/editcomment.php b/editcomment.php index ed3a9e4..527e56e 100644 --- a/editcomment.php +++ b/editcomment.php @@ -33,7 +33,7 @@ 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 = new CommentAPI(); $commentapi->set('commentid', $input->in['commentid']); $commentapi->set_condition(); $commentapi->fetch(); @@ -191,7 +191,7 @@ if ($_REQUEST['do'] == 'edit') $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(); diff --git a/editreport.php b/editreport.php index 9c55f87..ea84e93 100644 --- a/editreport.php +++ b/editreport.php @@ -57,7 +57,7 @@ $log->set_bugid($bug['bugid']); $notif = new NotificationCenter; -$bugapi = new BugAPI($bugsys); +$bugapi = new BugAPI(); $bugapi->set('bugid', $input->in['bugid']); $bugapi->set_condition(); $bugapi->dorelations = array(); @@ -144,7 +144,7 @@ if ($_POST['do'] == 'update') $commenttext = $input->in['comment']; } - $comment = new CommentAPI($bugsys); + $comment = new CommentAPI(); $comment->set('bugid', $input->in['bugid']); $comment->set('userid', bugdar::$userinfo['userid']); $comment->set('comment', $commenttext); diff --git a/install/install.php b/install/install.php index 3f11e7c..9b9e451 100644 --- a/install/install.php +++ b/install/install.php @@ -310,7 +310,7 @@ if ($input->in['mark'] == 8) // the installer, so we need to do it manually build_usergroups(); - $user = new UserAPI($bugsys); + $user = new UserAPI(); $user->set('email', $input->in['email']); $user->set('displayname', $input->in['displayname']); $user->set('password', $input->in['password']); diff --git a/login.php b/login.php index 1472312..0d7bd7f 100755 --- a/login.php +++ b/login.php @@ -104,7 +104,7 @@ if ($_REQUEST['do'] == 'logout') if ($_POST['do'] == 'sendpw') { - $user = new UserAPI($bugsys); + $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(); @@ -154,7 +154,7 @@ if ($_POST['do'] == 'resetpw') $message->error(L_INVALID_ID); } - $user = new UserAPI($bugsys); + $user = new UserAPI(); $user->set('userid', $activation['userid']); if ($input->in['fix_password'] != $input->in['confirm_password']) diff --git a/newreport.php b/newreport.php index 34da248..1b77ead 100755 --- a/newreport.php +++ b/newreport.php @@ -52,8 +52,8 @@ if (empty($_REQUEST['do'])) if ($_POST['do'] == 'insert') { - $bug = new BugAPI($bugsys); - $comment = new CommentAPI($bugsys); + $bug = new BugAPI(); + $comment = new CommentAPI(); $notif = new NotificationCenter(); @@ -106,7 +106,7 @@ if ($_POST['do'] == 'insert') $notif->send_new_bug_notice($bug->values, $comment->values); - $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(); diff --git a/register.php b/register.php index 04e04dc..c662ccf 100755 --- a/register.php +++ b/register.php @@ -73,7 +73,7 @@ if ($_POST['do'] == 'insert') } } - $user = new UserAPI($bugsys); + $user = new UserAPI(); $user->set('email', $input->in['email']); $user->set('displayname', $input->in['displayname']); $user->set('password', $input->in['password']); diff --git a/userctrl.php b/userctrl.php index 3981483..3b02a13 100644 --- a/userctrl.php +++ b/userctrl.php @@ -38,7 +38,7 @@ if (!bugdar::$userinfo['userid']) $message->errorPermission(); } -$userapi = new UserAPI($bugsys); +$userapi = new UserAPI(); $userapi->set('userid', bugdar::$userinfo['userid']); $userapi->setCondition(); -- 2.22.5