diff --git a/module/product/control.php b/module/product/control.php index cb532aedbd..dbe54bcad4 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -72,11 +72,11 @@ class product extends control * @param string $status * @param int $productID * @param int $branch - * @param int $PRJMine + * @param int $projectMine * @access public * @return void */ - public function project($status = 'all', $productID = 0, $branch = 0, $PRJMine = 0) + public function project($status = 'all', $productID = 0, $branch = 0, $projectMine = 0) { $this->product->setMenu($this->products, $productID, $branch); $this->lang->product->switcherMenu = $this->product->getSwitcher($productID); @@ -87,7 +87,7 @@ class product extends control /* Get PM id list. */ $accounts = array(); - $projectStats = $this->product->getProjectStatsByProduct($productID, $status, $branch, $PRJMine); + $projectStats = $this->product->getProjectStatsByProduct($productID, $status, $branch, $projectMine); foreach($projectStats as $project) { if(!empty($project->PM) and !in_array($project->PM, $accounts)) $accounts[] = $project->PM; @@ -200,11 +200,11 @@ class product extends control if($this->app->rawModule == 'projectstory') { $this->session->set('currentProductType', $product->type); - $projectProducts = $this->product->getProductsByProject($this->session->PRJ); + $projectProducts = $this->product->getProductsByProject($this->session->project); $productPlans = $this->loadModel('project')->getPlans($projectProducts); if($browseType == 'bybranch') $param = $branch; - $stories = $this->story->getProjectStories($this->session->PRJ, $productID, $branch, $sort, $browseType, $param, 'story', '', $pager); + $stories = $this->story->getProjectStories($this->session->project, $productID, $branch, $sort, $browseType, $param, 'story', '', $pager); } /* Process the sql, get the conditon partion, save it to session. */ @@ -299,7 +299,7 @@ class product extends control $this->executeHooks($productID); $moduleName = $programID ? 'program' : $this->moduleName; - $methodName = $programID ? 'pgmproduct' : 'browse'; + $methodName = $programID ? 'product' : 'browse'; $param = $programID ? "programID=$programID" : "productID=$productID"; $locate = $this->createLink($moduleName, $methodName, $param); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate)); @@ -308,7 +308,7 @@ class product extends control if($programID) { $this->app->rawModule = 'program'; - $this->app->rawMethod = 'pgmproduct'; + $this->app->rawMethod = 'product'; $this->lang->navGroup->program = 'program'; $this->loadModel('program')->setPGMViewMenu($programID); $this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true); @@ -435,7 +435,7 @@ class product extends control $this->executeHooks($productID); $moduleName = $programID ? 'program' : 'product'; - $methodName = $programID ? 'pgmproduct' : 'view'; + $methodName = $programID ? 'product' : 'view'; $param = $programID ? "programID=$programID" : "product=$productID"; $locate = $this->createLink($moduleName, $methodName, $param); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate)); @@ -450,7 +450,7 @@ class product extends control if($programID) { $this->app->rawModule = 'program'; - $this->app->rawMethod = 'pgmproduct'; + $this->app->rawMethod = 'product'; $this->lang->navGroup->program = 'program'; $this->loadModel('program')->setPGMViewMenu($programID); $this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true); @@ -520,7 +520,7 @@ class product extends control } } - $locate = $this->createLink('program', 'pgmproduct', "programID=$programID"); + $locate = $this->createLink('program', 'product', "programID=$programID"); die(js::locate($locate, 'parent')); } @@ -542,7 +542,7 @@ class product extends control /* Navigation remains under the program. */ $this->app->rawModule = 'program'; - $this->app->rawMethod = 'pgmproduct'; + $this->app->rawMethod = 'product'; $this->lang->navGroup->program = 'program'; $this->loadModel('program')->setPGMViewMenu($programID); $this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true); @@ -899,7 +899,7 @@ class product extends control $moduleGroup = zget($this->lang->navGroup, $module); $moduleGroup = in_array($moduleGroup, array('product', 'qa'))? $moduleGroup : 'project'; - $products = $moduleGroup == 'project' ? $this->product->getProductsByProject($this->session->PRJ) : $this->product->getList(); + $products = $moduleGroup == 'project' ? $this->product->getProductsByProject($this->session->project) : $this->product->getList(); $this->view->link = $this->product->getProductLink($module, $method, $extra); $this->view->productID = $productID; @@ -907,7 +907,7 @@ class product extends control $this->view->method = $method; $this->view->extra = $extra; $this->view->products = $products; - $this->view->projectID = $moduleGroup == 'project' ? $this->session->PRJ : 0; + $this->view->projectID = $moduleGroup == 'project' ? $this->session->project : 0; $this->view->programs = $this->loadModel('program')->getPGMPairs(true); $this->view->openApp = $moduleGroup; $this->display(); @@ -957,7 +957,7 @@ class product extends control $moduleIndex = array_search('product', $this->lang->noMenuModule); if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); - $this->view->project = $this->loadModel('program')->getPRJById($this->session->PRJ); + $this->view->project = $this->loadModel('project')->getById($this->session->project); } $this->loadModel($fromModule)->setMenu($this->products, key($this->products)); @@ -1168,7 +1168,7 @@ class product extends control $this->session->set('productList', $this->app->getURI(true)); /* Get all product list. Locate to the create product page if there is no product. */ - $this->products = $this->product->getPairs('', $this->session->PRJ); + $this->products = $this->product->getPairs('', $this->session->project); if(empty($this->products) and strpos('create|view', $this->methodName) === false) $this->locate($this->createLink('product', 'create')); /* Get current product. */ diff --git a/module/product/model.php b/module/product/model.php index 679d0236b4..2c51361194 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -864,11 +864,11 @@ class productModel extends model * @param int $productID * @param string $browseType * @param int $branch - * @param int $PRJMine + * @param int $projectMine * @access public * @return array */ - public function getProjectListByProduct($productID, $browseType = 'all', $branch = 0, $PRJMine = 0) + public function getProjectListByProduct($productID, $browseType = 'all', $branch = 0, $projectMine = 0) { $projectList = $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') @@ -876,7 +876,7 @@ class productModel extends model ->andWhere('t2.type')->eq('project') ->beginIF($browseType != 'all')->andWhere('t2.status')->eq($browseType)->fi() ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() - ->beginIF($this->cookie->PRJMine or $PRJMine) + ->beginIF($this->cookie->projectMine or $projectMine) ->andWhere('t2.openedBy', true)->eq($this->app->user->account) ->orWhere('t2.PM')->eq($this->app->user->account) ->markRight(1) @@ -899,13 +899,13 @@ class productModel extends model * @param int $productID * @param string $browseType * @param int $branch - * @param int $PRJMine + * @param int $projectMine * @access public * @return array */ - public function getProjectStatsByProduct($productID, $browseType = 'all', $branch = 0, $PRJMine = 0) + public function getProjectStatsByProduct($productID, $browseType = 'all', $branch = 0, $projectMine = 0) { - $projects = $this->getProjectListByProduct($productID, $browseType, $branch, $PRJMine); + $projects = $this->getProjectListByProduct($productID, $browseType, $branch, $projectMine); if(empty($projects)) return array(); $projectKeys = array_keys($projects); @@ -914,12 +914,12 @@ class productModel extends model $emptyHour = array('totalEstimate' => 0, 'totalConsumed' => 0, 'totalLeft' => 0, 'progress' => 0); /* Get all tasks and compute totalEstimate, totalConsumed, totalLeft, progress according to them. */ - $tasks = $this->dao->select('id, PRJ, estimate, consumed, `left`, status, closedReason') + $tasks = $this->dao->select('id, project, estimate, consumed, `left`, status, closedReason') ->from(TABLE_TASK) - ->where('PRJ')->in($projectKeys) + ->where('project')->in($projectKeys) ->andWhere('parent')->lt(1) ->andWhere('deleted')->eq(0) - ->fetchGroup('PRJ', 'id'); + ->fetchGroup('project', 'id'); /* Compute totalEstimate, totalConsumed, totalLeft. */ foreach($tasks as $projectID => $projectTasks) @@ -990,7 +990,7 @@ class productModel extends model if(empty($productID)) return array(); if(empty($projectID)) return $this->getAllExecutionPairsByProduct($productID, $branch); - $project = $this->loadModel('program')->getPRJByID($projectID); + $project = $this->loadModel('project')->getByID($projectID); $orderBy = $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc'; $executions = $this->dao->select('t2.id,t2.name,t2.grade,t2.parent')->from(TABLE_PROJECTPRODUCT)->alias('t1') @@ -1059,7 +1059,7 @@ class productModel extends model foreach($executions as $id => $execution) $projectIdList[$execution->project] = $execution->project; $executionPairs = array(); - $projectPairs = $this->loadModel('program')->getPRJPairsByIdList($projectIdList); + $projectPairs = $this->loadModel('project')->getPairsByIdList($projectIdList); foreach($executions as $id => $execution) { if($execution->grade == 2 && isset($executions[$execution->parent])) diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index f9c7c8721e..d113442d97 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -14,7 +14,7 @@ -session->PRJ);?> +session->project);?> app->rawModule);?> app->rawModule == 'projectstory'; if(commonModel::isTutorialMode()) { $wizardParams = helper::safe64Encode("productID=$productID&branch=$branch&moduleID=$moduleID"); - if($isProjectStory) $wizardParams = helper::safe64Encode("productID=$productID&branch=$branch&moduleID=$moduleID&storyID=&projectID={$this->session->PRJ}"); + if($isProjectStory) $wizardParams = helper::safe64Encode("productID=$productID&branch=$branch&moduleID=$moduleID&storyID=&projectID={$this->session->project}"); $link = $this->createLink('tutorial', 'wizard', "module=story&method=create¶ms=$wizardParams"); echo html::a($link, $lang->story->createCommon, '', "data-group='$openApp'"); } else { $link = $this->createLink('story', 'create', "product=$productID&branch=$branch&moduleID=$moduleID&storyID=0&projectID=0&bugID=0&planID=0&todoID=0&extra=&type=$storyType"); - if($isProjectStory) $link = $this->createLink('story', 'create', "product=$productID&branch=$branch&moduleID=$moduleID&storyID=0&projectID={$this->session->PRJ}"); + if($isProjectStory) $link = $this->createLink('story', 'create', "product=$productID&branch=$branch&moduleID=$moduleID&storyID=0&projectID={$this->session->project}"); $disabled = ''; if(!common::hasPriv('story', 'create')) { @@ -158,7 +158,7 @@ $isProjectStory = $this->app->rawModule == 'projectstory';
story->noStory : $lang->story->noRequirement;?> - session->PRJ : 0;?> + session->project : 0;?> createLink('story', 'create', "productID={$productID}&branch={$branch}&moduleID={$moduleID}&storyID=0&projectID=$projectID&bugID=0&planID=0&todoID=0&extra=&type=$storyType"), " " . $lang->story->createCommon, '', "class='btn btn-info' data-group='$openApp'");?> diff --git a/module/product/view/project.html.php b/module/product/view/project.html.php index 779319baab..7645c461ab 100644 --- a/module/product/view/project.html.php +++ b/module/product/view/project.html.php @@ -15,7 +15,7 @@ project->featureBar['all'] as $key => $label):?> {$label}" . ($status == $key ? " " . count($projectStats) . "" : ''), '', "class='btn btn-link" . ($status == $key ? ' btn-active-text' : '') . "' id='{$key}Tab'");?> - $lang->program->mine), '', $this->cookie->PRJMine ? 'checked=checked' : '');?> + $lang->program->mine), '', $this->cookie->projectMine ? 'checked=checked' : '');?>
- program->noPRJ;?> + project->empty;?>
product->noProduct;?> id&programID=$project->parent", " " . $lang->program->PRJManageProducts, '', "class='btn btn-info'");?>
+product->noProduct;?> id&programID=$project->parent", " " . $lang->project->manageProducts, '', "class='btn btn-info'");?>
" + project +"
"; + } + $('#promptTable').append("" + project +"
"; - } - $('#promptTable').append("