* Finish task #46660.
This commit is contained in:
@@ -361,8 +361,12 @@ $lang->action->dynamicAction->branch['activated'] = 'Activate Branch';
|
||||
$lang->action->dynamicAction->branch['setdefaultbranch'] = 'Set Default Branch';
|
||||
$lang->action->dynamicAction->branch['mergebranch'] = 'Merge Branch';
|
||||
|
||||
$lang->action->dynamicAction->productplan['opened'] = 'Create Plan';
|
||||
$lang->action->dynamicAction->productplan['edited'] = 'Edit Plan';
|
||||
$lang->action->dynamicAction->productplan['opened'] = 'Create Plan';
|
||||
$lang->action->dynamicAction->productplan['edited'] = 'Edit Plan';
|
||||
$lang->action->dynamicAction->productplan['started'] = "Start Plan";
|
||||
$lang->action->dynamicAction->productplan['finished'] = "Finish Plan";
|
||||
$lang->action->dynamicAction->productplan['closed'] = "Close Plan";
|
||||
$lang->action->dynamicAction->productplan['activated'] = "Activate Plan";
|
||||
|
||||
$lang->action->dynamicAction->release['opened'] = 'Create Release';
|
||||
$lang->action->dynamicAction->release['edited'] = 'Edit Release';
|
||||
|
||||
@@ -361,8 +361,12 @@ $lang->action->dynamicAction->branch['activated'] = '激活分支';
|
||||
$lang->action->dynamicAction->branch['setdefaultbranch'] = '设置默认分支';
|
||||
$lang->action->dynamicAction->branch['mergebranch'] = '合并分支';
|
||||
|
||||
$lang->action->dynamicAction->productplan['opened'] = "创建计划";
|
||||
$lang->action->dynamicAction->productplan['edited'] = "编辑计划";
|
||||
$lang->action->dynamicAction->productplan['opened'] = "创建计划";
|
||||
$lang->action->dynamicAction->productplan['edited'] = "编辑计划";
|
||||
$lang->action->dynamicAction->productplan['started'] = "开始计划";
|
||||
$lang->action->dynamicAction->productplan['finished'] = "完成计划";
|
||||
$lang->action->dynamicAction->productplan['closed'] = "关闭计划";
|
||||
$lang->action->dynamicAction->productplan['activated'] = "激活计划";
|
||||
|
||||
$lang->action->dynamicAction->release['opened'] = '创建发布';
|
||||
$lang->action->dynamicAction->release['edited'] = '编辑发布';
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
$config->productplan = new stdclass();
|
||||
$config->productplan->create = new stdclass();
|
||||
$config->productplan->edit = new stdclass();
|
||||
$config->productplan->start = new stdclass();
|
||||
$config->productplan->create->requiredFields = 'title';
|
||||
$config->productplan->edit->requiredFields = 'title';
|
||||
$config->productplan->start->requiredFields = 'begin,end';
|
||||
|
||||
$config->productplan->editor = new stdclass();
|
||||
$config->productplan->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
|
||||
@@ -236,7 +236,7 @@ class productplan extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($productID = 0, $branch = 0, $browseType = 'all', $orderBy = 'begin_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1 )
|
||||
public function browse($productID = 0, $branch = 0, $browseType = 'doing', $orderBy = 'begin_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1 )
|
||||
{
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
@@ -351,6 +351,129 @@ class productplan extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Start a plan.
|
||||
*
|
||||
* @param int $planID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function start($planID, $confirm = 'no')
|
||||
{
|
||||
$plan = $this->productplan->getByID($planID);
|
||||
if(!isonlybody())
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->productplan->confirmStart, $this->createLink('productplan', 'start', "planID=$planID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$changes = $this->productplan->updateStatus($planID, 'doing');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('productplan', $planID, 'started');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$changes = $this->productplan->updateStatus($planID, 'doing');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('productplan', $planID, 'started');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess,'locate' => 'parent'));
|
||||
}
|
||||
$this->view->plan = $plan;
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finish a plan.
|
||||
*
|
||||
* @param int $planID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function finish($planID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->productplan->confirmFinish, $this->createLink('productplan', 'finish', "planID=$planID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$changes = $this->productplan->updateStatus($planID, 'done');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('productplan', $planID, 'finished');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a plan.
|
||||
*
|
||||
* @param int $planID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function close($planID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->productplan->confirmClose, $this->createLink('productplan', 'close', "planID=$planID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$changes = $this->productplan->updateStatus($planID, 'closed');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('productplan', $planID, 'closed');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a plan.
|
||||
*
|
||||
* @param int $planID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function activate($planID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->productplan->confirmActivate, $this->createLink('productplan', 'activate', "planID=$planID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$changes = $this->productplan->updateStatus($planID, 'doing');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('productplan', $planID, 'activated');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax: Get product plans.
|
||||
*
|
||||
|
||||
@@ -15,6 +15,10 @@ $lang->productplan->index = "List";
|
||||
$lang->productplan->create = "Create Plan";
|
||||
$lang->productplan->edit = "Edit Plan";
|
||||
$lang->productplan->delete = "Delete Plan";
|
||||
$lang->productplan->start = "Start Plan";
|
||||
$lang->productplan->finish = "Finish Plan";
|
||||
$lang->productplan->close = "Close Plan";
|
||||
$lang->productplan->activate = "Activate Plan";
|
||||
$lang->productplan->view = "Plan Detail";
|
||||
$lang->productplan->bugSummary = "Total <strong>%s</strong> Bugs on this page.";
|
||||
$lang->productplan->basicInfo = 'Basic Info';
|
||||
@@ -44,10 +48,15 @@ $lang->productplan->linkedBugs = 'Linked Bugs';
|
||||
$lang->productplan->unlinkedBugs = 'Unlinked Bugs';
|
||||
$lang->productplan->unexpired = 'Unexpired Plans';
|
||||
$lang->productplan->all = 'All Plans';
|
||||
$lang->productplan->setDate = "Set Start and end Date";
|
||||
|
||||
$lang->productplan->confirmDelete = "Do you want to delete this plan?";
|
||||
$lang->productplan->confirmUnlinkStory = "Do you want to unlink this story?";
|
||||
$lang->productplan->confirmUnlinkBug = "Do you want to unlink this bug?";
|
||||
$lang->productplan->confirmStart = "Do you want to start this plan?";
|
||||
$lang->productplan->confirmFinish = "Do you want to finish this plan?";
|
||||
$lang->productplan->confirmClose = "Do you want to close this plan?";
|
||||
$lang->productplan->confirmActivate = "Do you want to activate this plan?";
|
||||
$lang->productplan->noPlan = 'No plans yet. ';
|
||||
$lang->productplan->cannotDeleteParent = 'Cannot delete parent plan';
|
||||
$lang->productplan->selectProjects = "Please select the project";
|
||||
@@ -74,6 +83,7 @@ $lang->productplan->childrenAB = "C";
|
||||
$lang->productplan->order = "Order";
|
||||
$lang->productplan->deleted = "Deleted";
|
||||
$lang->productplan->mailto = "Mailto";
|
||||
$lang->productplan->status = 'Status';
|
||||
|
||||
$lang->productplan->endList[7] = '1 Week';
|
||||
$lang->productplan->endList[14] = '2 Weeks';
|
||||
@@ -92,6 +102,8 @@ $lang->productplan->endGreaterParent = "The completion date of the parent plan:
|
||||
$lang->productplan->noLinkedProject = "The current product has not been linked with a project. Please enter the list of the product to link or create a project.";
|
||||
$lang->productplan->enterProjectList = "Enter the list of the product";
|
||||
|
||||
$lang->productplan->featureBar['browse']['all'] = 'All';
|
||||
$lang->productplan->featureBar['browse']['unexpired'] = 'Unexpired';
|
||||
$lang->productplan->featureBar['browse']['overdue'] = 'Expired';
|
||||
$lang->productplan->featureBar['browse']['all'] = 'All';
|
||||
$lang->productplan->featureBar['browse']['wait'] = 'Waiting';
|
||||
$lang->productplan->featureBar['browse']['doing'] = 'Doing';
|
||||
$lang->productplan->featureBar['browse']['done'] = 'Done';
|
||||
$lang->productplan->featureBar['browse']['closed'] = 'Closed';
|
||||
|
||||
@@ -15,6 +15,10 @@ $lang->productplan->index = "计划列表";
|
||||
$lang->productplan->create = "创建计划";
|
||||
$lang->productplan->edit = "编辑计划";
|
||||
$lang->productplan->delete = "删除计划";
|
||||
$lang->productplan->start = "开始计划";
|
||||
$lang->productplan->finish = "完成计划";
|
||||
$lang->productplan->close = "关闭计划";
|
||||
$lang->productplan->activate = "激活计划";
|
||||
$lang->productplan->view = "计划详情";
|
||||
$lang->productplan->bugSummary = "本页共 <strong>%s</strong> 个Bug";
|
||||
$lang->productplan->basicInfo = '基本信息';
|
||||
@@ -44,10 +48,15 @@ $lang->productplan->linkedBugs = 'Bug';
|
||||
$lang->productplan->unlinkedBugs = '未关联Bug';
|
||||
$lang->productplan->unexpired = "未过期计划";
|
||||
$lang->productplan->all = "所有计划";
|
||||
$lang->productplan->setDate = "设置计划起止时间";
|
||||
|
||||
$lang->productplan->confirmDelete = "您确认删除该计划吗?";
|
||||
$lang->productplan->confirmUnlinkStory = "您确认移除该{$lang->SRCommon}吗?";
|
||||
$lang->productplan->confirmUnlinkBug = "您确认移除该Bug吗?";
|
||||
$lang->productplan->confirmStart = "您确认开始该计划吗?";
|
||||
$lang->productplan->confirmFinish = "您确认完成该计划吗?";
|
||||
$lang->productplan->confirmClose = "您确认关闭该计划吗?";
|
||||
$lang->productplan->confirmActivate = "您确认激活该计划吗?";
|
||||
$lang->productplan->noPlan = "暂时没有计划。";
|
||||
$lang->productplan->cannotDeleteParent = "不能删除父计划";
|
||||
$lang->productplan->selectProjects = "请选择所属项目";
|
||||
@@ -74,6 +83,7 @@ $lang->productplan->childrenAB = "子";
|
||||
$lang->productplan->order = "排序";
|
||||
$lang->productplan->deleted = "已删除";
|
||||
$lang->productplan->mailto = "抄送给";
|
||||
$lang->productplan->status = '状态';
|
||||
|
||||
$lang->productplan->endList[7] = '一星期';
|
||||
$lang->productplan->endList[14] = '两星期';
|
||||
@@ -92,6 +102,8 @@ $lang->productplan->endGreaterParent = "父计划的完成日期:%s,完成
|
||||
$lang->productplan->noLinkedProject = "当前产品还未关联项目,请进入产品的项目列表关联或创建一个项目";
|
||||
$lang->productplan->enterProjectList = "进入产品的项目列表";
|
||||
|
||||
$lang->productplan->featureBar['browse']['all'] = '全部';
|
||||
$lang->productplan->featureBar['browse']['unexpired'] = '未过期';
|
||||
$lang->productplan->featureBar['browse']['overdue'] = '已过期';
|
||||
$lang->productplan->featureBar['browse']['all'] = '所有';
|
||||
$lang->productplan->featureBar['browse']['wait'] = '未开始';
|
||||
$lang->productplan->featureBar['browse']['doing'] = '进行中';
|
||||
$lang->productplan->featureBar['browse']['done'] = '已完成';
|
||||
$lang->productplan->featureBar['browse']['closed'] = '已关闭';
|
||||
|
||||
@@ -77,14 +77,13 @@ class productplanModel extends model
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getList($product = 0, $branch = 0, $browseType = 'all', $pager = null, $orderBy = 'begin_desc')
|
||||
public function getList($product = 0, $branch = 0, $browseType = 'doing', $pager = null, $orderBy = 'begin_desc')
|
||||
{
|
||||
$date = date('Y-m-d');
|
||||
$plans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('product')->eq($product)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF(!empty($branch))->andWhere('branch')->eq($branch)->fi()
|
||||
->beginIF($browseType == 'unexpired')->andWhere('end')->ge($date)->fi()
|
||||
->beginIF($browseType == 'overdue')->andWhere('end')->lt($date)->fi()
|
||||
->beginIF($browseType != 'all')->andWhere('status')->eq($browseType)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
@@ -479,6 +478,53 @@ class productplanModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a plan's status.
|
||||
*
|
||||
* @param int $planID
|
||||
* @param string $status
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function updateStatus($planID, $status = '')
|
||||
{
|
||||
$oldPlan = $this->dao->findByID((int)$planID)->from(TABLE_PRODUCTPLAN)->fetch();
|
||||
|
||||
if($status == 'doing' and $_POST)
|
||||
{
|
||||
$plan = fixer::input('post')->add('status', $status)->get();
|
||||
if(strpos($this->config->productplan->start->requiredFields, 'begin') !== false and empty($_POST['begin']))
|
||||
{
|
||||
dao::$errors['begin'] = sprintf($this->lang->error->notempty, $this->lang->productplan->begin);
|
||||
}
|
||||
if(strpos($this->config->productplan->start->requiredFields, 'end') !== false and empty($_POST['end']))
|
||||
{
|
||||
dao::$errors['end'] = sprintf($this->lang->error->notempty, $this->lang->productplan->end);
|
||||
}
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)
|
||||
->data($plan)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->productplan->start->requiredFields, 'notempty')
|
||||
->checkIF(!empty($_POST['begin']) && !empty($_POST['end']), 'end', 'ge', $plan->begin)
|
||||
->where('id')->eq((int)$planID)
|
||||
->exec();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)
|
||||
->set('`status`')->eq($status)
|
||||
->where('id')->eq((int)$planID)
|
||||
->exec();
|
||||
|
||||
$plan = $this->dao->findByID((int)$planID)->from(TABLE_PRODUCTPLAN)->fetch();
|
||||
}
|
||||
|
||||
if(!dao::isError())return common::createChanges($oldPlan, $plan);
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch update plan.
|
||||
*
|
||||
|
||||
@@ -128,6 +128,23 @@
|
||||
<?php foreach($extendFields as $extendField) echo "<td>" . $this->loadModel('flow')->getFieldValue($extendField, $plan) . "</td>";?>
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
if($plan->begin == '2030-01-01' or $plan->end == '2030-01-01')
|
||||
{
|
||||
$class = 'iframe';
|
||||
$attr = "data-toggle='modal' data-id='{$plan->id}' data-width='550px'";
|
||||
$isOnlyBody = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$attr = "target='hiddenwin'";
|
||||
$isOnlyBody = false;
|
||||
}
|
||||
$class = $plan->status == 'wait' ? $class : 'disabled';
|
||||
common::printLink('productplan', 'start', "planID=$plan->id", '<i class="icon-play"></i>', '', "class='btn {$class}'{$attr} title='{$lang->productplan->start}'", '', $isOnlyBody);
|
||||
$class = $plan->status == 'doing' ? '' : 'disabled';
|
||||
common::printLink('productplan', 'finish', "planID=$plan->id", '<i class="icon-checked"></i>', '', "class='btn {$class}' target='hiddenwin' title='{$lang->productplan->finish}'");
|
||||
$class = $plan->status == 'done' ? '' : 'disabled';
|
||||
common::printLink('productplan', 'close', "planID=$plan->id", '<i class="icon-off"></i>', '', "class='btn {$class}' target='hiddenwin' title='{$lang->productplan->close}'");
|
||||
$attr = $plan->expired ? "disabled='disabled'" : '';
|
||||
if(common::hasPriv('execution', 'create', $plan) and $plan->parent >= 0)
|
||||
{
|
||||
|
||||
43
module/productplan/view/start.html.php
Normal file
43
module/productplan/view/start.html.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* The start view of productplan module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author MengYi Liu <liumengyi@easycorp.ltd>
|
||||
* @package productplan
|
||||
* @version $Id: start.html.php 4728 2021-12-28 09:57:34Z $
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<style>
|
||||
.table-form {margin-top: 90px;}
|
||||
.form-actions {height:150px;}
|
||||
</style>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->productplan->setDate;?></strong></h2>
|
||||
</div>
|
||||
<form class="load-indicator main-form form-ajax" method='post' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->productplan->begin;?></th>
|
||||
<td colspan='2'><?php echo html::input('begin', $plan->begin != '2030-01-01' ? formatTime($plan->begin) : '', "class='form-control form-date'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->productplan->end;?></th>
|
||||
<td colspan='2'><?php echo html::input('end', $plan->end != '2030-01-01' ? formatTime($plan->end) : '', 'class="form-control form-date"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='4' class='text-center form-actions'>
|
||||
<?php echo html::submitButton($lang->productplan->start);?>
|
||||
<?php echo html::commonButton($lang->cancel, "data-dismiss='modal'", 'btn btn-wide');?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
Reference in New Issue
Block a user