From dc0ecc890ed77dbc879dec9c1f53e0a1a9dc2b84 Mon Sep 17 00:00:00 2001 From: daitingting Date: Tue, 6 Sep 2022 05:26:47 +0000 Subject: [PATCH] * Optimize codes. --- module/bug/control.php | 2 +- module/company/control.php | 14 +++++++------- module/company/model.php | 1 + module/upgrade/model.php | 3 +-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 2181a64837..1cfc4850ee 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -364,7 +364,7 @@ class bug extends control if(!empty($_POST)) { - $response['result'] = 'success'; + $response['result'] = 'success'; /* Set from param if there is a object to transfer bug. */ setcookie('lastBugModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false); diff --git a/module/company/control.php b/module/company/control.php index 641876ccf0..9e22d7d373 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -107,8 +107,8 @@ class company extends control return print(js::reload('parent.parent')); } - $this->view->title = $this->lang->company->common . $this->lang->colon . $this->lang->company->create; - $this->view->position = $this->lang->company->create; + $this->view->title = $this->lang->company->common . $this->lang->colon . $this->lang->company->create; + $this->view->position = $this->lang->company->create; $this->display(); } @@ -136,9 +136,9 @@ class company extends control $this->company->setMenu(); $title = $this->lang->company->common . $this->lang->colon . $this->lang->company->edit; $position[] = $this->lang->company->edit; - $this->view->title = $title; - $this->view->position = $position; - $this->view->company = $this->company->getById($this->app->company->id); + $this->view->title = $title; + $this->view->position = $position; + $this->view->company = $this->company->getById($this->app->company->id); $this->display(); } @@ -253,8 +253,8 @@ class company extends control /* Get actions. */ if($browseType != 'bysearch') { - if(!$productID) $productID = 'all'; - if(!$projectID) $projectID = 'all'; + if(!$productID) $productID = 'all'; + if(!$projectID) $projectID = 'all'; if(!$executionID) $executionID = 'all'; $actions = $this->action->getDynamic($account, $browseType, $orderBy, $pager, $productID, $projectID, $executionID, $date, $direction); } diff --git a/module/company/model.php b/module/company/model.php index 4c98aa2076..eeabdbbc22 100644 --- a/module/company/model.php +++ b/module/company/model.php @@ -66,6 +66,7 @@ class companyModel extends model /** * Get users. * + * @param string $browseType * @param string $type * @param int $queryID * @param int $deptID diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 5a097582c4..2fd714ae1f 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -6786,14 +6786,13 @@ class upgradeModel extends model public function processCreatedInfo() { $objectTypes = array('productplan', 'release', 'testtask', 'build'); - $tables = array('productplan' => TABLE_PRODUCTPLAN, 'release' => TABLE_RELEASE, 'testtask' => TABLE_TESTTASK, 'build' => TABLE_BUILD); $actions = $this->dao->select('objectType, objectID, actor, date')->from(TABLE_ACTION)->where('objectType')->in($objectTypes)->andWhere('action')->eq('opened')->fetchGroup('objectType'); foreach($actions as $objectType => $objectActions) { foreach($objectActions as $action) { - $this->dao->update($tables[$objectType])->set('createdBy')->eq($action->actor)->set('createdDate')->eq($action->date)->where('id')->eq($action->objectID)->exec(); + $this->dao->update($this->config->objectTables[$objectType])->set('createdBy')->eq($action->actor)->set('createdDate')->eq($action->date)->where('id')->eq($action->objectID)->exec(); } }