diff --git a/module/execution/control.php b/module/execution/control.php index 36ba4edfa7..e734c2bc25 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -446,13 +446,12 @@ class execution extends control * @param int $executionID * @param int $fromExecution * @param string $orderBy - * @param int $recTotal * @param int $recPerPage * @param int $pageID * @access public * @return void */ - public function importTask($toExecution, $fromExecution = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function importTask($toExecution, $fromExecution = 0, $orderBy = 'id_desc', $recPerPage = 20, $pageID = 1) { if(!empty($_POST)) $this->execution->importTask($toExecution); @@ -1840,12 +1839,11 @@ class execution extends control */ public function edit(int $executionID, string $action = 'edit', string $extra = '', string $newPlans = '', string $confirm = 'no') { - /* Load language files and get browseExecutionLink. */ + /* Load language files. */ $this->loadModel('product'); $this->app->loadLang('program'); $this->app->loadLang('stage'); $this->app->loadLang('programplan'); - $browseExecutionLink = $this->createLink('execution', 'browse', "executionID=$executionID"); $execution = $this->execution->getById($executionID); $branches = $this->project->getBranchesByProject($executionID); $linkedProductIdList = empty($branches) ? '' : array_keys($branches); @@ -1950,10 +1948,6 @@ class execution extends control /* Remove current execution from the executions. */ unset($executions[$executionID]); - $title = $this->lang->execution->edit . $this->lang->colon . $execution->name; - $position[] = html::a($browseExecutionLink, $execution->name); - $position[] = $this->lang->execution->edit; - $allProducts = $this->product->getProducts($execution->project, 'noclosed', '', false, $linkedProductIdList); $allProducts = array(0 => '') + $allProducts; @@ -2019,7 +2013,7 @@ class execution extends control unset($parentStageList[0]); } - $this->view->title = $title; + $this->view->title = $this->lang->execution->edit . $this->lang->colon . $execution->name; $this->view->position = $position; $this->view->executions = $executions; $this->view->execution = $execution; @@ -3041,8 +3035,6 @@ class execution extends control /* use first execution if executionID does not exist. */ if(!isset($this->executions[$executionID])) $executionID = key($this->executions); - $browseExecutionLink = $this->createLink('execution', 'browse', "executionID=$executionID"); - $this->loadModel('product'); $execution = $this->execution->getById($executionID); $project = $this->loadModel('project')->getByID($execution->project); @@ -3053,8 +3045,6 @@ class execution extends control { $oldProducts = $this->product->getProducts($executionID); - if($from == 'buildCreate' && $this->session->buildCreate) $browseExecutionLink = $this->session->buildCreate; - $this->execution->updateProducts($executionID); if(dao::isError()) return $this->sendError(dao::getError()); @@ -3071,10 +3061,6 @@ class execution extends control $this->execution->setMenu($execution->id); /* Title and position. */ - $title = $this->lang->execution->manageProducts . $this->lang->colon . $execution->name; - $position[] = html::a($browseExecutionLink, $execution->name); - $position[] = $this->lang->execution->manageProducts; - $branches = $this->project->getBranchesByProject($executionID); $linkedProductIdList = empty($branches) ? array() : array_keys($branches); $allProducts = $this->product->getProductPairsByProject($execution->project, 'all', implode(',', $linkedProductIdList)); @@ -3105,7 +3091,7 @@ class execution extends control } /* Assign. */ - $this->view->title = $title; + $this->view->title = $this->lang->execution->manageProducts . $this->lang->colon . $execution->name; $this->view->position = $position; $this->view->allProducts = $allProducts; $this->view->execution = $execution; @@ -3213,14 +3199,13 @@ class execution extends control * @param int $objectID * @param string $browseType * @param int $param - * @param int $recTotal * @param int $recPerPage * @param int $pageID * @param string $extra * @access public * @return void */ - public function linkStory($objectID = 0, $browseType = '', $param = 0, $recTotal = 0, $recPerPage = 50, $pageID = 1, $extra = '') + public function linkStory($objectID = 0, $browseType = '', $param = 0, $recPerPage = 50, $pageID = 1, $extra = '') { $this->loadModel('story'); $this->loadModel('product'); @@ -4063,13 +4048,12 @@ class execution extends control * @param int $executionID * @param int $planID * @param int $productID - * @param string $fromMethod * @param string $extra * @param string $param * @access public * @return void */ - public function importPlanStories(int $executionID, int $planID, int $productID = 0, string $fromMethod = 'story', string $extra = '', string $param = '') + public function importPlanStories(int $executionID, int $planID, int $productID = 0, string $extra = '', string $param = '') { $planStories = $planProducts = array(); $planStory = $this->loadModel('story')->getPlanStories($planID); diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 021a1f82d7..06c3a07be0 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -278,7 +278,7 @@ function createColumnCreateMenu(options) { if(priv.canCreateStory) items.push({label: storyLang.create, url: $.createLink('story', 'create', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&objectID=' + executionID + '&bugID=0&planID=0&todoID=0&extra=regionID=' + regionID + ',laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(priv.canBatchCreateStory) items.push({label: executionLang.batchCreateStory, url: productCount > 1 ? '#batchCreateStory' : $.createLink('story', 'batchcreate', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&executionID=' + executionID + '&plan=0&type=story&extra=regionID=' + regionID + ',laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe',attrs: {'data-toggle': 'modal', 'data-width': '90%'}}); - if(priv.canLinkStory) items.push({label: executionLang.linkStory, url: $.createLink('execution', 'linkStory', 'executionID=' + executionID + '&browseType=¶m=0&recTotal=0&recPerPage=50,&pageID=1&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}}); + if(priv.canLinkStory) items.push({label: executionLang.linkStory, url: $.createLink('execution', 'linkStory', 'executionID=' + executionID + '&browseType=¶m=0&recPerPage=50,&pageID=1&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}}); if(priv.canLinkStoryByPlan) items.push({label: executionLang.linkStoryByPlan, url: '#linkStoryByPlan', 'attrs' : {'data-toggle': 'modal', 'data-target': '#linkStoryByPlan','data-col' : col.id, 'data-lane' : laneID, 'class' : 'linkStoryByPlanButton'}}); } else if(col.type == 'unconfirmed') @@ -1561,7 +1561,7 @@ $(function() { var vars = $('.linkStoryByPlanButton').data('lane') != null ? '&extra=laneID='+ $('.linkStoryByPlanButton').data('lane') + ',columnID=' + $('.linkStoryByPlanButton').data('col') : ''; var param = "¶m=executionID=" + executionID + ",browseType=" + browseType + ",orderBy=id_asc,groupBy=" + groupBy; - location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=kanban' + vars + param); + location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0' + vars + param); $.closeModal(); } }); diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index 22c1700835..5990301889 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -1318,7 +1318,7 @@ $(function() if(planID) { var param = "¶m=executionID=" + executionID + ",browseType=" + browseType + ",orderBy=id_asc,groupBy=" + groupBy; - location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=taskKanban&extra=' + param); + location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&extra=' + param); } }); diff --git a/module/execution/ui/importtask.html.php b/module/execution/ui/importtask.html.php index 1cb94cf77d..24f35c7ea3 100644 --- a/module/execution/ui/importtask.html.php +++ b/module/execution/ui/importtask.html.php @@ -36,7 +36,7 @@ $config->task->dtable->importTask->fieldList['execution']['map'] = $executions; if($execution->lifetime == 'ops' || in_array($execution->attribute, array('request', 'review'))) unset($config->task->dtable->importTask->fieldList['story']); jsVar('orderBy', $orderBy); -jsVar('sortLink', helper::createLink('execution', 'importTask', "executionID={$execution->id}&fromExecution={$fromExecution}&orderBy={orderBy}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}")); +jsVar('sortLink', helper::createLink('execution', 'importTask', "executionID={$execution->id}&fromExecution={$fromExecution}&orderBy={orderBy}&recPerPage={$pager->recPerPage}")); dtable ( set::userMap($memberPairs), @@ -59,10 +59,10 @@ dtable ) )), set::footPager( - usePager(), - set::recPerPage($pager->recPerPage), - set::recTotal($pager->recTotal), - set::linkCreator(helper::createLink('execution', 'importTask', "executionID={$execution->id}&fromExecution={$fromExecution}&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={recPerPage}&page={page}")) + usePager + ( + array('linkCreator' => helper::createLink('execution', 'importTask', "executionID={$execution->id}&fromExecution={$fromExecution}&orderBy=$orderBy&recPerPage={recPerPage}&page={page}")) + ), ) ); diff --git a/module/projectstory/control.php b/module/projectstory/control.php index cd8754d8bf..a4e0b26c4b 100644 --- a/module/projectstory/control.php +++ b/module/projectstory/control.php @@ -111,15 +111,14 @@ class projectStory extends control * @param int $projectID * @param string $browseType * @param int $param - * @param int $recTotal * @param int $recPerPage * @param int $pageID * @access public * @return void */ - public function linkStory($projectID = 0, $browseType = '', $param = 0, $recTotal = 0, $recPerPage = 50, $pageID = 1) + public function linkStory($projectID = 0, $browseType = '', $param = 0, $recPerPage = 50, $pageID = 1) { - echo $this->fetch('execution', 'linkStory', "projectID=$projectID&browseType=$browseType¶m=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); + echo $this->fetch('execution', 'linkStory', "projectID=$projectID&browseType=$browseType¶m=$param&recPerPage=$recPerPage&pageID=$pageID"); } /**