diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index f2a0de8e24..4dbe278e22 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -60,9 +60,9 @@ productplan->begin);?> productplan->end);?> - productplan->stories;?> - productplan->bugs;?> - productplan->hour;?> + productplan->stories;?> + productplan->bugs;?> + productplan->hour;?> productplan->execution;?> productplan->desc;?> program->datatable->fieldList['PRJName']['width'] = 'auto'; $config->program->datatable->fieldList['PRJName']['required'] = 'yes'; $config->program->datatable->fieldList['PRJName']['sort'] = 'no'; -//$config->program->datatable->fieldList['PRJProgram']['title'] = 'common'; -//$config->program->datatable->fieldList['PRJProgram']['fixed'] = 'left'; -//$config->program->datatable->fieldList['PRJProgram']['width'] = '140'; -//$config->program->datatable->fieldList['PRJProgram']['required'] = 'no'; -//$config->program->datatable->fieldList['PRJProgram']['sort'] = 'no'; - $config->program->datatable->fieldList['PM']['title'] = 'PM'; $config->program->datatable->fieldList['PM']['fixed'] = 'no'; $config->program->datatable->fieldList['PM']['width'] = '80'; diff --git a/module/program/control.php b/module/program/control.php index a14256563b..c94b7a5c44 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -460,8 +460,6 @@ class program extends control */ public function PGMStakeholder($programID = 0, $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1) { - $this->loadModel('user'); - $this->app->loadLang('user'); $this->lang->navGroup->program = 'program'; $this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true); $this->lang->program->mainMenuAction = $this->program->getPGMMainAction(); @@ -1009,11 +1007,11 @@ class program extends control $parentProgram = $this->program->getPGMByID($programID); /* If the story of the product which linked the project, you don't allow to remove the product. */ - $notRemoveProducts = array(); + $unmodifiableProducts = array(); foreach($linkedProducts as $productID => $linkedProduct) { $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->andWhere('product')->eq($productID)->fetchAll('story'); - if(!empty($projectStories)) array_push($notRemoveProducts, $productID); + if(!empty($projectStories)) array_push($unmodifiableProducts, $productID); } foreach($linkedProducts as $product) @@ -1038,7 +1036,7 @@ class program extends control $this->view->allProducts = array('0' => '') + $allProducts; $this->view->productPlans = $productPlans; $this->view->linkedProducts = $linkedProducts; - $this->view->notRemoveProducts = $notRemoveProducts; + $this->view->unmodifiableProducts = $unmodifiableProducts; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($linkedProducts), '', $linkedBranches); $this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs(); $this->view->from = $from; @@ -1093,8 +1091,8 @@ class program extends control foreach($projects as $project) $appendPMUsers[$project->PM] = $project->PM; - $this->view->title = $this->lang->program->batchEdit; - $this->view->position[] = $this->lang->program->batchEdit; + $this->view->title = $this->lang->program->batchEdit; + $this->view->position[] = $this->lang->program->batchEdit; $this->view->projectIdList = $projectIdList; $this->view->projects = $projects; @@ -1803,11 +1801,11 @@ class program extends control $linkedBranches = array(); /* If the story of the product which linked the project, you don't allow to remove the product. */ - $notRemoveProducts = array(); + $unmodifiableProducts = array(); foreach($linkedProducts as $productID => $linkedProduct) { $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->andWhere('product')->eq($productID)->fetchAll('story'); - if(!empty($projectStories)) array_push($notRemoveProducts, $productID); + if(!empty($projectStories)) array_push($unmodifiableProducts, $productID); } /* Merge allProducts and linkedProducts for closed product. */ @@ -1822,7 +1820,7 @@ class program extends control $this->view->position[] = $this->lang->project->manageProducts; $this->view->allProducts = $allProducts; $this->view->linkedProducts = $linkedProducts; - $this->view->notRemoveProducts = $notRemoveProducts; + $this->view->unmodifiableProducts = $unmodifiableProducts; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($allProducts), '', $linkedBranches); $this->display(); diff --git a/module/program/css/common.css b/module/program/css/common.css index 613a945348..0ec990860f 100644 --- a/module/program/css/common.css +++ b/module/program/css/common.css @@ -1,2 +1,2 @@ .future {display: inline-block} -.c-number {overflow:hidden;text-align:right!important;text-overflow:ellipsis;white-space:nowrap} +.c-number {overflow: hidden; text-align: right!important; text-overflow: ellipsis; white-space: nowrap;} diff --git a/module/program/js/prjedit.js b/module/program/js/prjedit.js index 5b45cdb4e4..3f97f538d6 100644 --- a/module/program/js/prjedit.js +++ b/module/program/js/prjedit.js @@ -25,7 +25,7 @@ $(function() for(var i in data.message) { var product = data.message[i]; - $('#promptTable').append("" + product +" " + linkedProjectsTip +""); + $('#promptTable').append(" " + product +" " + linkedProjectsTip +""); for(var j in data.multiLinkedProjects) { if(i == j) @@ -34,7 +34,7 @@ $(function() for(k in data.multiLinkedProjects[j]) { var project = data.multiLinkedProjects[j][k]; - html += "

" + project +"

"; + html += "

" + project +"

"; } $('#promptTable').append("" + html + ""); } @@ -56,7 +56,7 @@ $(function() /* If the story of the product which linked the execution under the project, you don't allow to remove the product. */ $("#productsBox select").each(function() { - var isExisted = $.inArray($(this).attr('data-last'), notRemoveProducts); + var isExisted = $.inArray($(this).attr('data-last'), unmodifiableProducts); if(isExisted != -1) { $(this).prop('disabled', true).trigger("chosen:updated"); diff --git a/module/program/model.php b/module/program/model.php index 57cfe0926b..2cc4237685 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -465,12 +465,13 @@ class programModel extends model */ public function getTopPGMByID($programID) { - $topPGM = 0; - if(empty($programID)) return $topPGM; + if(empty($programID)) return 0; $program = $this->getPGMByID($programID); - if(!empty($program)) list($topPGM) = explode(',', trim($program->path, ',')); - return $topPGM; + if(empty($program)) return 0; + + $path = explode(',', trim($program->path, ',')); + return $path[0]; } /** diff --git a/module/program/view/prjbatchedit.html.php b/module/program/view/prjbatchedit.html.php index f967ddf336..fb3913b3f4 100644 --- a/module/program/view/prjbatchedit.html.php +++ b/module/program/view/prjbatchedit.html.php @@ -22,9 +22,9 @@ - - - + + + diff --git a/module/program/view/prjedit.html.php b/module/program/view/prjedit.html.php index 5353831000..cf577331c3 100644 --- a/module/program/view/prjedit.html.php +++ b/module/program/view/prjedit.html.php @@ -19,7 +19,7 @@ id);?> program->PRJLongTime);?> - +program->notAllowRemoveProducts);?> program->linkedProjectsTip);?> parent ? $lang->program->PGMPRJAclList : $lang->program->PRJAclList;?> @@ -109,7 +109,7 @@ id], $product->branch, "class='form-control chosen' onchange=\"loadPlans('#products{$i}', this.value)\"");?> - id, $notRemoveProducts)) echo html::hidden("products[$i]", $product->id);?> + id, $unmodifiableProducts)) echo html::hidden("products[$i]", $product->id);?>
' style="padding-right: 6px;"> diff --git a/module/program/view/prjmanageproducts.html.php b/module/program/view/prjmanageproducts.html.php index 1989abafac..889f9bf631 100644 --- a/module/program/view/prjmanageproducts.html.php +++ b/module/program/view/prjmanageproducts.html.php @@ -24,8 +24,8 @@
$productName):?> - - program->notAllowRemoveProducts : $productName;?> + + program->notAllowRemoveProducts : $productName;?>
'> diff --git a/module/project/control.php b/module/project/control.php index e583e4d2af..a58688973d 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1312,11 +1312,11 @@ class project extends control $linkedBranches = array(); /* If the story of the product which linked the execution, you don't allow to remove the product. */ - $notRemoveProducts = array(); + $unmodifiableProducts = array(); foreach($linkedProducts as $productID => $linkedProduct) { $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->andWhere('product')->eq($productID)->fetchAll('story'); - if(!empty($projectStories)) array_push($notRemoveProducts, $productID); + if(!empty($projectStories)) array_push($unmodifiableProducts, $productID); } foreach($linkedProducts as $product) @@ -1378,7 +1378,7 @@ class project extends control $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->allProducts = $allProducts; $this->view->linkedProducts = $linkedProducts; - $this->view->notRemoveProducts = $notRemoveProducts; + $this->view->unmodifiableProducts = $unmodifiableProducts; $this->view->productPlans = $productPlans; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($linkedProducts), '', $linkedBranches); $this->display(); @@ -2038,11 +2038,11 @@ class project extends control $linkedBranches = array(); /* If the story of the product which linked the execution, you don't allow to remove the product. */ - $notRemoveProducts = array(); + $unmodifiableProducts = array(); foreach($linkedProducts as $productID => $linkedProduct) { $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->andWhere('product')->eq($productID)->fetchAll('story'); - if(!empty($projectStories)) array_push($notRemoveProducts, $productID); + if(!empty($projectStories)) array_push($unmodifiableProducts, $productID); } // Merge allProducts and linkedProducts for closed product. @@ -2058,7 +2058,7 @@ class project extends control $this->view->allProducts = $allProducts; $this->view->project = $project; $this->view->linkedProducts = $linkedProducts; - $this->view->notRemoveProducts = $notRemoveProducts; + $this->view->unmodifiableProducts = $unmodifiableProducts; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($allProducts), '', $linkedBranches); $this->display(); @@ -2806,6 +2806,7 @@ class project extends control $planStories = $planProducts = array(); $planStory = $this->loadModel('story')->getPlanStories($planID); $project = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch(); + $count = 0; if(!empty($planStory)) { diff --git a/module/project/css/task.css b/module/project/css/task.css index da3e956069..7fcc556426 100644 --- a/module/project/css/task.css +++ b/module/project/css/task.css @@ -1,4 +1,4 @@ -td.delayed{background: #e84e0f!important; color: white;} -#int-dropdown{margin-left: -8px; border-radius: 4px; border: 1px solid #0c64eb} -#projectTaskForm table tbody tr td{overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} -th.c-deadline{text-align:center;} +td.delayed {background: #e84e0f!important; color: white;} +#int-dropdown {margin-left: -8px; border-radius: 4px; border: 1px solid #0c64eb} +#projectTaskForm table tbody tr td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} +th.c-deadline {text-align:center;} diff --git a/module/project/js/edit.js b/module/project/js/edit.js index 4e1fb36f85..3b1a920272 100644 --- a/module/project/js/edit.js +++ b/module/project/js/edit.js @@ -12,7 +12,7 @@ $(function() /* If the story of the product which linked the execution under the project, you don't allow to remove the product. */ $("#productsBox select").each(function() { - var isExisted = $.inArray($(this).attr('data-last'), notRemoveProducts); + var isExisted = $.inArray($(this).attr('data-last'), unmodifiableProducts); if(isExisted != -1) { $(this).prop('disabled', true).trigger("chosen:updated"); diff --git a/module/project/model.php b/module/project/model.php index 5492d729db..d74152fead 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2154,10 +2154,9 @@ class projectModel extends model if($statusPairs[$storyID] == 'draft' || $statusPairs[$storyID] == 'closed') continue; if(isset($linkedStories[$storyID])) continue; - $productID = (empty($products) and $this->app->rawMethod == 'batchcreate') ? $this->cookie->preProductID : (int)$products[$storyID]; $data = new stdclass(); $data->project = $projectID; - $data->product = $productID; + $data->product = (int)$products[$storyID]; $data->story = $storyID; $data->version = $versions[$storyID]; $data->order = ++$lastOrder; @@ -2263,7 +2262,7 @@ class projectModel extends model if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getTeamMembers(); $project = $this->getByID($projectID); - $type = $this->config->global->mode == 'new' ? $project->type : 'project'; + $type = $this->config->systemMode == 'new' ? $project->type : 'project'; if(empty($project)) return array(); return $this->dao->select("t1.*, t1.hours * t1.days AS totalHours, t2.id as userID, if(t2.deleted='0', t2.realname, t1.account) as realname")->from(TABLE_TEAM)->alias('t1') diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 7d0c3e2fc6..24c0648bdd 100644 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -140,7 +140,7 @@ id], $product->branch, "class='form-control chosen' $class onchange=\"loadPlans('#products{$i}', this.value)\"");?>
- id, $notRemoveProducts)) echo html::hidden("products[$i]", $product->id);?> + id, $unmodifiableProducts)) echo html::hidden("products[$i]", $product->id);?> @@ -189,6 +189,6 @@
project->weekend);?> project->errorSameProducts);?> - + project->notAllowRemoveProducts);?> diff --git a/module/project/view/manageproducts.html.php b/module/project/view/manageproducts.html.php index ff34a78e8c..a668a6ece1 100644 --- a/module/project/view/manageproducts.html.php +++ b/module/project/view/manageproducts.html.php @@ -25,8 +25,8 @@ grade == 2 ? "disabled='disabled'" : '';?> $productName):?> - - project->notAllowRemoveProducts : $productName;?> + + project->notAllowRemoveProducts : $productName;?>
'> diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 90d309659e..8d84d217b3 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -50,7 +50,7 @@ if(common::canModify('project', $project)) { - /*$this->lang->story->create = $this->lang->project->createStory; + $this->lang->story->create = $this->lang->project->createStory; if($productID and !$this->loadModel('story')->checkForceReview()) { echo "'; - }*/ + } if(commonModel::isTutorialMode()) { diff --git a/module/project/view/storykanban.html.php b/module/project/view/storykanban.html.php index f186e4cf1e..dabcd9e01b 100644 --- a/module/project/view/storykanban.html.php +++ b/module/project/view/storykanban.html.php @@ -37,7 +37,7 @@ } ?>
- loadModel('story')->checkForceReview()) common::printLink('story', 'create', "productID=$productID&branch=&moduleID=0&story=0&project=$project->id", " " . $lang->project->createStory, '', "class='btn btn-primary' class='btn btn-link export' data-group='project'");?> + loadModel('story')->checkForceReview()) common::printLink('story', 'create', "productID=$productID&branch=&moduleID=0&story=0&project=$project->id", " " . $lang->project->createStory, '', "class='btn btn-primary' class='btn btn-link export' data-group='project'");?>
type != 'normal') echo html::select('branch', $branches, $branch, "class='form-control chosen control-branch'");?> - + + diff --git a/module/story/control.php b/module/story/control.php index ef15300913..c5e2788075 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -378,8 +378,10 @@ class story extends control /* Project or execution linked stories. */ if($project) { - $this->loadModel('project')->linkStory($project, $stories); - if($project != $this->session->PRJ) $this->loadModel('project')->linkStory($this->session->PRJ, $stories); + $products = array(); + foreach($mails as $story) $products[$story->storyID] = $productID; + $this->loadModel('project')->linkStory($project, $stories, $products); + if($project != $this->session->PRJ) $this->loadModel('project')->linkStory($this->session->PRJ, $stories, $products); } /* If storyID not equal zero, subdivide this story to child stories and close it. */ diff --git a/module/todo/model.php b/module/todo/model.php index 0a73e65880..78f8116157 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -32,7 +32,7 @@ class todoModel extends model ->setIF($hasObject && $objectType, 'idvalue', $idvalue) ->setIF($this->post->date == false, 'date', '2030-01-01') ->setIF($this->post->begin == false, 'begin', '2400') - ->setIF($this->post->begin == false or $this->post->end == false, 'end', '2400') + ->setIF($this->post->begin == false or $this->post->end == false, 'end', '2400') ->stripTags($this->config->todo->editor->create['id'], $this->config->allowedTags) ->remove('bug, task, story, issue, risk, review, testtask, uid, feedback') ->get();
idAB;?> program->PGMParent;?>program->PRJName;?> idAB;?> program->PGMParent;?>program->PRJName;?> program->PRJPM;?>
release->date;?>