From 527a9a11364fa7a47344ccf9eef2bf1f32d9cc02 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 7 Sep 2023 16:10:30 +0800 Subject: [PATCH] * Fix error for variable is undefined. --- module/block/zen.php | 2 +- module/project/control.php | 4 ++-- module/project/ui/browsebycard.html.php | 4 ++-- module/project/ui/browsebylist.html.php | 2 +- module/project/ui/bug.html.php | 3 +-- module/project/ui/create.html.php | 7 ++++--- module/project/ui/edit.html.php | 1 - module/project/ui/execution.html.php | 9 +++++---- module/project/ui/group.html.php | 1 - module/project/ui/manageproducts.html.php | 2 ++ module/project/ui/team.html.php | 1 - module/project/zen.php | 1 + module/projectrelease/control.php | 1 + module/projectrelease/ui/browse.html.php | 2 +- 14 files changed, 21 insertions(+), 19 deletions(-) diff --git a/module/block/zen.php b/module/block/zen.php index 004d75c8dd..95978f1c5c 100644 --- a/module/block/zen.php +++ b/module/block/zen.php @@ -1348,7 +1348,7 @@ class blockZen extends block $project = zget($totalData, $projectID, new stdclass()); $this->app->loadClass('pager', true); $pager = pager::init(0, 3, 1); - $project->progress = $project->allStories == 0 ? 0 : round($project->doneStories / $project->allStories, 3) * 100; + $project->progress = empty($project->allStories) ? 0 : round($project->doneStories / $project->allStories, 3) * 100; $project->executions = $this->loadModel('execution')->getStatData($projectID, 'all', 0, 0, false, '', 'id_desc', $pager); $this->view->totalData = $totalData; diff --git a/module/project/control.php b/module/project/control.php index 283afa1ef7..2f87c2f6a3 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1398,7 +1398,7 @@ class project extends control { $projectID = $this->project->setMenu($projectID); $project = $this->project->getByID($projectID); - if(isset($project->acl) and $project->acl == 'open') return $this->sendError($this->lang->whitelistNotNeed, $this->createLink('project', 'index', "projectID=$projectID")); + if(isset($project->acl) and $project->acl == 'open') return $this->sendError($this->lang->whitelistNotNeed, true); echo $this->fetch('personnel', 'whitelist', "objectID=$projectID&module=project&browseType=project&orderBy=id_desc&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID&from=$from"); } @@ -1454,7 +1454,7 @@ class project extends control /* If hasProduct is 0, return. */ $projectID = (int)$projectID; $project = $this->project->getById($projectID); - if(!$project->hasProduct) return print(js::error($this->lang->project->cannotManageProducts) . js::locate('back')); + if(!$project->hasProduct) return $this->sendError($this->lang->project->cannotManageProducts, true); $executions = $this->loadModel('execution')->getPairs($projectID); $IdList = array_keys($executions); diff --git a/module/project/ui/browsebycard.html.php b/module/project/ui/browsebycard.html.php index a38bc2124a..d86ba16ca1 100644 --- a/module/project/ui/browsebycard.html.php +++ b/module/project/ui/browsebycard.html.php @@ -18,7 +18,7 @@ if(empty($globalDisableProgram)) set::title($programs[$programID]), set::items($programs), set::activeKey($programID), - set::link(createLink('project', 'browse', "programID={key}&browseType={$browseType}¶m={$param}&orderBy=order_asc&recTotal={$recTotal}&recPerPage={$recPerPage}&pageID={$pageID}")), + set::link(createLink('project', 'browse', "programID={key}&browseType={$browseType}¶m={$param}&orderBy=order_asc&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}")), ); } featureBar @@ -58,7 +58,7 @@ toolbar 'icon' => 'export', 'text' => $lang->project->export, 'class' => 'ghost export', - 'url' => createLink('project', 'export', "status={$status}&orderBy={$orderBy}"), + 'url' => createLink('project', 'export', "status={$browseType}&orderBy={$orderBy}"), 'data-toggle' => 'modal' ))) : null, hasPriv('project', 'createGuide') ? item(set(array diff --git a/module/project/ui/browsebylist.html.php b/module/project/ui/browsebylist.html.php index 7871518dfa..8b8d86c2cb 100644 --- a/module/project/ui/browsebylist.html.php +++ b/module/project/ui/browsebylist.html.php @@ -47,7 +47,7 @@ toolbar 'icon' => 'export', 'text' => $lang->project->export, 'class' => 'ghost export', - 'url' => createLink('project', 'export', "status={$status}&orderBy={$orderBy}"), + 'url' => createLink('project', 'export', "status={$browseType}&orderBy={$orderBy}"), 'data-toggle' => 'modal' ))), item(set(array diff --git a/module/project/ui/bug.html.php b/module/project/ui/bug.html.php index 6694726cb4..a36fd19c13 100644 --- a/module/project/ui/bug.html.php +++ b/module/project/ui/bug.html.php @@ -37,7 +37,7 @@ toolbar ))) : null, ); -$closeLink = $type != 'bysearch' ? createLink('project', 'bug', "project={$project->id}&productID={$productID}&branch=$branch&orderBy=$orderBy&build=$buildID&type=$type¶m=0&orderBy=$orderBy&recTotal=0&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("bugModule")'; +$closeLink = $type != 'bysearch' ? createLink('project', 'bug', "projectID={$project->id}&productID={$productID}&branchID=$branchID&orderBy=$orderBy&build=$buildID&type=$type¶m=0&orderBy=$orderBy&recTotal=0&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("bugModule")'; sidebar ( moduleMenu(set(array @@ -51,7 +51,6 @@ sidebar $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo'); $config->bug->dtable->fieldList['module']['map'] = $modulePairs; -$config->bug->dtable->fieldList['product']['map'] = $products; $config->bug->dtable->fieldList['story']['map'] = $stories; $config->bug->dtable->fieldList['task']['map'] = $tasks; $config->bug->dtable->fieldList['toTask']['map'] = $tasks; diff --git a/module/project/ui/create.html.php b/module/project/ui/create.html.php index 75d639a8cd..5cb1eb180d 100644 --- a/module/project/ui/create.html.php +++ b/module/project/ui/create.html.php @@ -341,7 +341,7 @@ formPanel ) ) ), - $products ? $productsBox : + !empty($products) ? $productsBox : formRow ( setClass('productBox'), @@ -383,6 +383,7 @@ formPanel picker ( set::name("branch[0][]"), + set::items(array()) ) ), ), @@ -396,7 +397,7 @@ formPanel picker ( set::name('plans[0][]'), - set::items(null), + set::items(array()) ) ), div @@ -411,7 +412,7 @@ formPanel ( setClass('btn ghost removeLine'), icon('trash'), - $i == 0 ? set::disabled(true) : null + empty($i) ? set::disabled(true) : null ), ) ), diff --git a/module/project/ui/edit.html.php b/module/project/ui/edit.html.php index 2556e9a216..fdb95fa281 100644 --- a/module/project/ui/edit.html.php +++ b/module/project/ui/edit.html.php @@ -8,7 +8,6 @@ jsVar('weekend', $config->execution->weekend); jsVar('unmodifiableProducts', $unmodifiableProducts); jsVar('unmodifiableBranches', $unmodifiableBranches); jsVar('unmodifiableMainBranches', $unmodifiableMainBranches); -jsVar('linkedProjectsTip', $linkedProjectsTip); jsVar('multiBranchProducts', $multiBranchProducts); jsVar('errorSameProducts', $lang->project->errorSameProducts); jsVar('beginLessThanParent', $lang->project->beginLessThanParent); diff --git a/module/project/ui/execution.html.php b/module/project/ui/execution.html.php index 6b3833aec7..19146ac96b 100644 --- a/module/project/ui/execution.html.php +++ b/module/project/ui/execution.html.php @@ -116,10 +116,11 @@ toolbar ( hasPriv('execution', 'export') ? item(set(array ( - 'icon' => 'export', - 'text' => $lang->programplan->exporting, - 'class' => "ghost export", - 'url' => createLink('execution', 'export', "status=$status&productID=$productID&orderBy=$orderBy&from=project"), + 'icon' => 'export', + 'text' => $lang->programplan->exporting, + 'class' => "ghost export", + 'data-toggle' => "modal", + 'url' => createLink('execution', 'export', "status=$status&productID=$productID&orderBy=$orderBy&from=project"), ))) : null, hasPriv('execution', 'create') ? item(set(array ( diff --git a/module/project/ui/group.html.php b/module/project/ui/group.html.php index ad960582c3..d9f9de3af9 100644 --- a/module/project/ui/group.html.php +++ b/module/project/ui/group.html.php @@ -39,7 +39,6 @@ dtable set::fixedLeftWidth('30%'), set::cols(array_values($config->projectGroup->dtable->fieldList)), set::data($groups), - set::footToolbar($footToolbar), ); render(); diff --git a/module/project/ui/manageproducts.html.php b/module/project/ui/manageproducts.html.php index 3f96210d39..9dba10f4bf 100644 --- a/module/project/ui/manageproducts.html.php +++ b/module/project/ui/manageproducts.html.php @@ -54,6 +54,8 @@ $index = 0; $linkedList = array(); foreach($allProducts as $productID => $productName) { + if(empty($linkedBranches[$productID])) continue; + $cannotUnlink = in_array($productID, $unmodifiableProducts) && $project->model == 'waterfall'; foreach($linkedBranches[$productID] as $branchID) diff --git a/module/project/ui/team.html.php b/module/project/ui/team.html.php index e0ccd4fa27..8abf28b0c5 100644 --- a/module/project/ui/team.html.php +++ b/module/project/ui/team.html.php @@ -46,7 +46,6 @@ jsVar('noAccess', $lang->user->error->noAccess); dtable ( - set::userMap($users), set::cols($config->project->dtable->team->fieldList), set::data($teamMembers), set::onRenderCell(jsRaw('window.renderCell')), diff --git a/module/project/zen.php b/module/project/zen.php index 89c87a7aa8..fe4a78f35a 100644 --- a/module/project/zen.php +++ b/module/project/zen.php @@ -1080,6 +1080,7 @@ class projectZen extends project /* Build the product from other linked products. */ if($this->config->systemMode == 'ALM') $this->buildProductForm($project, $allProducts, $linkedBranchIdList, $linkedBranches, $linkedProducts); + $this->view->linkedBranches = $linkedBranches; $this->view->linkedProducts = $linkedProducts; $this->view->unmodifiableProducts = $unmodifiableProducts; $this->view->unmodifiableBranches = $unmodifiableBranches; diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index 99d105b93f..440a0e4860 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -107,6 +107,7 @@ class projectrelease extends control $this->view->type = $type; $this->view->from = $this->app->tab; $this->view->pager = $pager; + $this->view->orderBy = $orderBy; $this->view->showBranch = $showBranch; $this->display(); } diff --git a/module/projectrelease/ui/browse.html.php b/module/projectrelease/ui/browse.html.php index 6c8c2f1f73..cb7ff6d585 100644 --- a/module/projectrelease/ui/browse.html.php +++ b/module/projectrelease/ui/browse.html.php @@ -32,7 +32,7 @@ jsVar('markerTitle', $lang->release->marker); jsVar('showBranch', $showBranch); jsVar('products', $products); jsVar('orderBy', $orderBy); -jsVar('sortLink', helper::createLink('release', 'browse', "productID={$product->id}&branch={$branch}&type={$type}&orderBy={orderBy}¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}")); +jsVar('sortLink', helper::createLink('projectrelease', 'browse', "projectID={$project->id}&executionID={$executionID}&type={$type}&orderBy={orderBy}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}")); jsVar('pageAllSummary', $lang->release->pageAllSummary); jsVar('pageSummary', $lang->release->pageSummary); jsVar('type', $type);