diff --git a/module/kanban/model.php b/module/kanban/model.php index ee6580f9be..d13038a88d 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -537,7 +537,7 @@ class kanbanModel extends model $branches = array(); $colorIndex = 0; $laneOrder = 1; - $cardActions = array('view', 'createExecution', 'linkStory', 'linkBug', 'edit', 'start', 'finish', 'close', 'activate'); + $cardActions = array('view', 'createExecution', 'linkStory', 'linkBug', 'edit', 'start', 'finish', 'close', 'activate', 'delete'); if($product->type == 'normal') { diff --git a/module/my/control.php b/module/my/control.php index 748fcb8c36..6f6d6827d3 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -1078,6 +1078,7 @@ class my extends control $this->session->set('opportunityLibList', $uri, 'assetlib'); $this->session->set('practiceLibList', $uri, 'assetlib'); $this->session->set('componentLibList', $uri, 'assetlib'); + $this->session->set('opportunityList', $uri, 'project'); /* Set the pager. */ $this->app->loadClass('pager', $static = true); diff --git a/module/productplan/css/browse.css b/module/productplan/css/browse.css index d9750bbb47..154e628e50 100644 --- a/module/productplan/css/browse.css +++ b/module/productplan/css/browse.css @@ -18,7 +18,7 @@ td.c-branch {overflow: hidden; text-align: left !important; text-overflow: ellip .c-title {width: 160px;} .c-branch {width: 100px;} .c-story {width: 80px;} -.c-execution {width: 120px;} +.c-execution {width: 50px !important;} .c-bug, .c-hour {width: 60px;} .plan-name {position: relative; display: flex; align-items: center;} diff --git a/module/productplan/js/browse.js b/module/productplan/js/browse.js index 19e22af2a3..35a4c80cac 100644 --- a/module/productplan/js/browse.js +++ b/module/productplan/js/browse.js @@ -125,7 +125,11 @@ function createCardMenu(options) var executionLink = systemMode == 'new' ? '#projects' : createLink('execution', 'create', "projectID=0&executionID=0©ExecutionID=0&plan=" + card.id + "&confirm=no&productID=" + productID); var today = new Date(); var end = $.zui.createDate(card.end); - if(end.toLocaleDateString() < today.toLocaleDateString() && (card.status == 'wait' || card.status == 'doing')) + if(end.toLocaleDateString() < today.toLocaleDateString()) + { + className = 'disabled'; + } + else if(card.status == 'done' || card.status == 'closed') { className = 'disabled'; } @@ -163,6 +167,7 @@ function createCardMenu(options) if(privs.includes('finish')) items.push({label: productplanLang.finish, icon: 'checked', url: createLink('productplan', 'finish', "planID=" + card.id), attrs: {'target': 'hiddenwin'}}); if(privs.includes('close')) items.push({label: productplanLang.close, icon: 'off', url: createLink('productplan', 'close', "planID=" + card.id), attrs: {'target': 'hiddenwin'}}); if(privs.includes('activate')) items.push({label: productplanLang.activate, icon: 'magic', url: createLink('productplan', 'activate', "planID=" + card.id), attrs: {'target': 'hiddenwin'}}); + if(privs.includes('delete')) items.push({label: productplanLang.delete, icon: 'trash', url: createLink('productplan', 'delete', "planID=" + card.id), attrs: {'target': 'hiddenwin'}}); var bounds = options.$trigger[0].getBoundingClientRect(); items.$options = {x: bounds.right, y: bounds.top}; @@ -302,7 +307,7 @@ function changeCardColType(card, fromColType, toColType, kanbanID) function renderKanbanItem(item, $item) { var privs = item.actions; - var printMoreBtn = (privs.includes('createExecution') || privs.includes('linkStory') || privs.includes('linkBug') || privs.includes('edit') || privs.includes('start') || privs.includes('finish') || privs.includes('close') || privs.includes('activate')); + var printMoreBtn = (privs.includes('createExecution') || privs.includes('linkStory') || privs.includes('linkBug') || privs.includes('edit') || privs.includes('start') || privs.includes('finish') || privs.includes('close') || privs.includes('activate') || privs.includes('delete')); /* Output header information. */ var $header = $item.children('.header'); @@ -324,7 +329,7 @@ function renderKanbanItem(item, $item) if(!$title.length) { if(privs.includes('view')) $title = $('').appendTo($titleBox).attr('href', createLink('productplan', 'view', 'cardID=' + item.id)); - if(!privs.includes('view')) $title = $('
').appendTo($titleBox); + if(!privs.includes('view')) $title = $('').appendTo($titleBox); } $title.text(item.title).attr('title', item.title); @@ -334,7 +339,7 @@ function renderKanbanItem(item, $item) var end = $.zui.createDate(item.end); if(end.toLocaleDateString() < today.toLocaleDateString() && (item.status == 'wait' || item.status == 'doing')) { - $expired = $('.titleBox').children('.expired'); + $expired = $titleBox.children('.expired'); if(!$expired.length) { $('' + productplanLang.expired + '').appendTo($titleBox); diff --git a/module/productplan/model.php b/module/productplan/model.php index 4561d53268..316b698401 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -537,11 +537,15 @@ class productplanModel extends model ->batchCheck($this->config->productplan->start->requiredFields, 'notempty') ->checkIF(!empty($_POST['begin']) && !empty($_POST['end']), 'end', 'ge', $plan->begin) ->where('id')->eq($planID) - ->beginIF(isset($parentPlan))->orWhere('id')->eq($oldPlan->parent)->fi() ->exec(); $this->file->updateObjectID($this->post->uid, $planID, 'productplan'); - if($parentPlan->status != 'doing') $parentChange = true; + + if(isset($parentPlan) and $parentPlan->status != 'doing') + { + $this->dao->update(TABLE_PRODUCTPLAN)->set('status')->eq($status)->where('id')->eq($oldPlan->parent)->exec(); + $parentChange = true; + } } elseif($status == 'doing' and isset($parentPlan) and $parentPlan->status != 'doing') { @@ -607,22 +611,22 @@ class productplanModel extends model if($method == 'start') { $action = 'started'; - if($parentChange) $parentAction = 'startedbychild'; + if(isset($parentChange) and $parentChange) $parentAction = 'startedbychild'; } elseif($method == 'finish') { $action = 'finished'; - if($parentChange) $parentAction = 'finishedbychild'; + if(isset($parentChange) and $parentChange) $parentAction = 'finishedbychild'; } elseif($method == 'close') { $action = 'closed'; - if($parentChange) $parentAction = 'closedbychild'; + if(isset($parentChange) and $parentChange) $parentAction = 'closedbychild'; } elseif($method == 'activate') { $action = 'activated'; - if($parentChange) $parentAction = 'activatedbychild'; + if(isset($parentChange) and $parentChange) $parentAction = 'activatedbychild'; } if(isset($action)) @@ -631,7 +635,7 @@ class productplanModel extends model $actionID = $this->loadModel('action')->create('productplan', $planID, $action); $this->action->loghistory($actionID, $changes); - if($parentChange) $actionID = $this->action->create('productplan', $oldPlan->parent, $parentAction, '', $parentAction); + if(isset($parentChange) and $parentChange) $actionID = $this->action->create('productplan', $oldPlan->parent, $parentAction, '', $parentAction); } } } @@ -726,17 +730,17 @@ class productplanModel extends model $maxEnd = $end; foreach($childPlans as $childPlan) { - if($childPlan->begin < $minBegin) $minBegin = $childPlan->begin; - if($childPlan->end > $maxEnd) $maxEnd = $childPlan->end; + if($childPlan->begin < $minBegin and $minBegin != '2030-01-01') $minBegin = $childPlan->begin; + if($childPlan->end > $maxEnd and $maxEnd != '2030-01-01') $maxEnd = $childPlan->end; } - if($minBegin < $begin) dao::$errors['begin'] = sprintf($this->lang->beginGreaterChild, $minBegin); - if($maxEnd > $end) dao::$errors['end'] = sprintf($this->lang->endLetterChild, $maxEnd); + if($minBegin < $begin and $begin != '2030-01-01') dao::$errors['begin'] = sprintf($this->lang->beginGreaterChild, $minBegin); + if($maxEnd > $end and $end != '2030-01-01') dao::$errors['end'] = sprintf($this->lang->endLetterChild, $maxEnd); } elseif($plan->parent > 0) { $parentPlan = $this->getByID($plan->parent); - if($begin < $parentPlan->begin) dao::$errors['begin'] = sprintf($this->lang->productplan->beginLetterParent, $parentPlan->begin); - if($end > $parentPlan->end) dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $parentPlan->end); + if($begin < $parentPlan->begin and $parentPlan->begin != '2030-01-01') dao::$errors['begin'] = sprintf($this->lang->productplan->beginLetterParent, $parentPlan->begin); + if($end > $parentPlan->end and $parentPlan->end != '2030-01-01') dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $parentPlan->end); } } @@ -966,7 +970,11 @@ class productplanModel extends model if($plan->status != 'done' or $plan->parent < 0) return false; break; case 'activate' : +<<<<<<< module/productplan/model.php if(($plan->status != 'closed' and $plan->status != 'done') or $plan->parent < 0) return false; +======= + if($plan->status == 'wait' or $plan == 'doing' or $plan->parent < 0) return false; +>>>>>>> module/productplan/model.php break; } diff --git a/module/productplan/view/browsebylist.html.php b/module/productplan/view/browsebylist.html.php index 6f3ce09231..5736b01423 100644 --- a/module/productplan/view/browsebylist.html.php +++ b/module/productplan/view/browsebylist.html.php @@ -78,6 +78,7 @@ loadModel('file');?> +| - + | + | + |
-
+
%
|
stage->typeList, '', "class='form-control'");?> | -project->aclList, 'open', "class='form-control' $class");?> | +project->aclList, 'open', "class='form-control' $class");?> | programplan->milestoneList, 0);?> | -- | - | - | + | + | + | + | config->qcVersion)):?> | diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 82cc615f3c..0285d8c651 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -193,7 +193,7 @@ |
| execution->totalEstimate;?> | -totalEstimate . $lang->execution->workHour;?> | +totalEstimate . $lang->execution->workHour;?> | execution->totalDays;?> | days;?> |
|---|