Merge branch 'sprint/185_zhouxin_49302' into 'sprint/185'
Sprint/185 zhouxin 49302 See merge request easycorp/zentaopms!1874
This commit is contained in:
@@ -563,22 +563,23 @@ $lang->story->methodOrder[140] = 'processStoryChange';
|
||||
|
||||
/* Product plan. */
|
||||
$lang->resource->productplan = new stdclass();
|
||||
$lang->resource->productplan->browse = 'browse';
|
||||
$lang->resource->productplan->create = 'create';
|
||||
$lang->resource->productplan->edit = 'edit';
|
||||
$lang->resource->productplan->delete = 'delete';
|
||||
$lang->resource->productplan->view = 'view';
|
||||
$lang->resource->productplan->linkStory = 'linkStory';
|
||||
$lang->resource->productplan->unlinkStory = 'unlinkStory';
|
||||
$lang->resource->productplan->batchUnlinkStory = 'batchUnlinkStory';
|
||||
$lang->resource->productplan->linkBug = 'linkBug';
|
||||
$lang->resource->productplan->unlinkBug = 'unlinkBug';
|
||||
$lang->resource->productplan->batchUnlinkBug = 'batchUnlinkBug';
|
||||
$lang->resource->productplan->batchEdit = 'batchEdit';
|
||||
$lang->resource->productplan->start = 'start';
|
||||
$lang->resource->productplan->finish = 'finish';
|
||||
$lang->resource->productplan->close = 'close';
|
||||
$lang->resource->productplan->activate = 'activate';
|
||||
$lang->resource->productplan->browse = 'browse';
|
||||
$lang->resource->productplan->create = 'create';
|
||||
$lang->resource->productplan->edit = 'edit';
|
||||
$lang->resource->productplan->delete = 'delete';
|
||||
$lang->resource->productplan->view = 'view';
|
||||
$lang->resource->productplan->linkStory = 'linkStory';
|
||||
$lang->resource->productplan->unlinkStory = 'unlinkStory';
|
||||
$lang->resource->productplan->batchUnlinkStory = 'batchUnlinkStory';
|
||||
$lang->resource->productplan->linkBug = 'linkBug';
|
||||
$lang->resource->productplan->unlinkBug = 'unlinkBug';
|
||||
$lang->resource->productplan->batchUnlinkBug = 'batchUnlinkBug';
|
||||
$lang->resource->productplan->batchEdit = 'batchEdit';
|
||||
$lang->resource->productplan->start = 'start';
|
||||
$lang->resource->productplan->finish = 'finish';
|
||||
$lang->resource->productplan->close = 'close';
|
||||
$lang->resource->productplan->activate = 'activate';
|
||||
$lang->resource->productplan->batchChangeStatus = 'batchChangeStatus';
|
||||
|
||||
$lang->productplan->methodOrder[5] = 'browse';
|
||||
$lang->productplan->methodOrder[10] = 'create';
|
||||
@@ -596,6 +597,7 @@ $lang->productplan->methodOrder[65] = 'start';
|
||||
$lang->productplan->methodOrder[70] = 'finish';
|
||||
$lang->productplan->methodOrder[75] = 'close';
|
||||
$lang->productplan->methodOrder[80] = 'activate';
|
||||
$lang->productplan->methodOrder[85] = 'batchChangeStatus';
|
||||
|
||||
/* Release. */
|
||||
$lang->resource->release = new stdclass();
|
||||
|
||||
@@ -181,6 +181,31 @@ class productplan extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch change the status of productplan.
|
||||
*
|
||||
* @param string $status
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchChangeStatus($status)
|
||||
{
|
||||
if($this->post->planIDList)
|
||||
{
|
||||
$planIDList = $this->post->planIDList;
|
||||
unset($_POST['planIDList']);
|
||||
$allChanges = $this->productplan->batchChangeStatus($planIDList, $status);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
foreach($allChanges as $planID => $changes)
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$actionID = $this->action->create('productplan', $planID, 'edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a plan.
|
||||
*
|
||||
|
||||
@@ -33,19 +33,20 @@ $lang->productplan->allAB = 'All';
|
||||
$lang->productplan->to = 'To';
|
||||
$lang->productplan->more = 'More';
|
||||
|
||||
$lang->productplan->batchUnlink = "Batch Unlink";
|
||||
$lang->productplan->unlinkAB = "Unlink";
|
||||
$lang->productplan->linkStory = "Link Story";
|
||||
$lang->productplan->unlinkStory = "Unlink Story";
|
||||
$lang->productplan->unlinkStoryAB = "Unlink";
|
||||
$lang->productplan->batchUnlinkStory = "Batch Unlink";
|
||||
$lang->productplan->linkedStories = 'Linked Stories';
|
||||
$lang->productplan->unlinkedStories = 'Unlinked Stories';
|
||||
$lang->productplan->updateOrder = 'Order';
|
||||
$lang->productplan->createChildren = "Create Child Plans";
|
||||
$lang->productplan->createExecution = "Create {$lang->execution->common}";
|
||||
$lang->productplan->list = 'List';
|
||||
$lang->productplan->kanban = 'Kanban';
|
||||
$lang->productplan->batchUnlink = "Batch Unlink";
|
||||
$lang->productplan->batchChangeStatus = "Batch Change Status";
|
||||
$lang->productplan->unlinkAB = "Unlink";
|
||||
$lang->productplan->linkStory = "Link Story";
|
||||
$lang->productplan->unlinkStory = "Unlink Story";
|
||||
$lang->productplan->unlinkStoryAB = "Unlink";
|
||||
$lang->productplan->batchUnlinkStory = "Batch Unlink";
|
||||
$lang->productplan->linkedStories = 'Linked Stories';
|
||||
$lang->productplan->unlinkedStories = 'Unlinked Stories';
|
||||
$lang->productplan->updateOrder = 'Order';
|
||||
$lang->productplan->createChildren = "Create Child Plans";
|
||||
$lang->productplan->createExecution = "Create {$lang->execution->common}";
|
||||
$lang->productplan->list = 'List';
|
||||
$lang->productplan->kanban = 'Kanban';
|
||||
|
||||
$lang->productplan->linkBug = "Link Bug";
|
||||
$lang->productplan->unlinkBug = "Unlink Bug";
|
||||
@@ -91,6 +92,7 @@ $lang->productplan->order = "Order";
|
||||
$lang->productplan->deleted = "Deleted";
|
||||
$lang->productplan->mailto = "Mailto";
|
||||
$lang->productplan->status = "Plan Status";
|
||||
$lang->productplan->planStatus = "Status";
|
||||
|
||||
$lang->productplan->statusList['wait'] = 'Wait';
|
||||
$lang->productplan->statusList['doing'] = 'Doing';
|
||||
@@ -132,6 +134,11 @@ $lang->productplan->featureBar['browse']['doing'] = 'Doing';
|
||||
$lang->productplan->featureBar['browse']['done'] = 'Done';
|
||||
$lang->productplan->featureBar['browse']['closed'] = 'Closed';
|
||||
|
||||
$lang->productplan->statusList['wait'] = 'Wait';
|
||||
$lang->productplan->statusList['doing'] = 'Doing';
|
||||
$lang->productplan->statusList['done'] = 'Done';
|
||||
$lang->productplan->statusList['closed'] = 'Closed';
|
||||
|
||||
$lang->productplan->orderList['begin_desc'] = 'Begin Descend';
|
||||
$lang->productplan->orderList['begin_asc'] = 'Begin Ascend';
|
||||
$lang->productplan->orderList['title_desc'] = 'Title Descend';
|
||||
|
||||
@@ -33,19 +33,20 @@ $lang->productplan->allAB = '所有';
|
||||
$lang->productplan->to = '至';
|
||||
$lang->productplan->more = '更多操作';
|
||||
|
||||
$lang->productplan->batchUnlink = "批量移除";
|
||||
$lang->productplan->unlinkAB = "移除";
|
||||
$lang->productplan->linkStory = "关联{$lang->SRCommon}";
|
||||
$lang->productplan->unlinkStory = "移除{$lang->SRCommon}";
|
||||
$lang->productplan->unlinkStoryAB = "移除";
|
||||
$lang->productplan->batchUnlinkStory = "批量移除{$lang->SRCommon}";
|
||||
$lang->productplan->linkedStories = $lang->SRCommon;
|
||||
$lang->productplan->unlinkedStories = "未关联{$lang->SRCommon}";
|
||||
$lang->productplan->updateOrder = '排序';
|
||||
$lang->productplan->createChildren = "创建子计划";
|
||||
$lang->productplan->createExecution = "创建{$lang->execution->common}";
|
||||
$lang->productplan->list = '列表';
|
||||
$lang->productplan->kanban = '看板';
|
||||
$lang->productplan->batchUnlink = "批量移除";
|
||||
$lang->productplan->batchChangeStatus = "批量修改状态";
|
||||
$lang->productplan->unlinkAB = "移除";
|
||||
$lang->productplan->linkStory = "关联{$lang->SRCommon}";
|
||||
$lang->productplan->unlinkStory = "移除{$lang->SRCommon}";
|
||||
$lang->productplan->unlinkStoryAB = "移除";
|
||||
$lang->productplan->batchUnlinkStory = "批量移除{$lang->SRCommon}";
|
||||
$lang->productplan->linkedStories = $lang->SRCommon;
|
||||
$lang->productplan->unlinkedStories = "未关联{$lang->SRCommon}";
|
||||
$lang->productplan->updateOrder = '排序';
|
||||
$lang->productplan->createChildren = "创建子计划";
|
||||
$lang->productplan->createExecution = "创建{$lang->execution->common}";
|
||||
$lang->productplan->list = '列表';
|
||||
$lang->productplan->kanban = '看板';
|
||||
|
||||
$lang->productplan->linkBug = "关联Bug";
|
||||
$lang->productplan->unlinkBug = "移除Bug";
|
||||
@@ -91,6 +92,7 @@ $lang->productplan->order = "排序";
|
||||
$lang->productplan->deleted = "已删除";
|
||||
$lang->productplan->mailto = "抄送给";
|
||||
$lang->productplan->status = "计划状态";
|
||||
$lang->productplan->planStatus = "状态";
|
||||
|
||||
$lang->productplan->statusList['wait'] = '未开始';
|
||||
$lang->productplan->statusList['doing'] = '进行中';
|
||||
@@ -132,6 +134,11 @@ $lang->productplan->featureBar['browse']['doing'] = '进行中';
|
||||
$lang->productplan->featureBar['browse']['done'] = '已完成';
|
||||
$lang->productplan->featureBar['browse']['closed'] = '已关闭';
|
||||
|
||||
$lang->productplan->statusList['wait'] = '未开始';
|
||||
$lang->productplan->statusList['doing'] = '进行中';
|
||||
$lang->productplan->statusList['done'] = '已完成';
|
||||
$lang->productplan->statusList['closed'] = '已关闭';
|
||||
|
||||
$lang->productplan->orderList['begin_desc'] = '计划开始时间倒序';
|
||||
$lang->productplan->orderList['begin_asc'] = '计划开始时间正序';
|
||||
$lang->productplan->orderList['title_desc'] = '计划名称倒序';
|
||||
|
||||
@@ -693,6 +693,33 @@ class productplanModel extends model
|
||||
return $changes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch change the status of productplan.
|
||||
*
|
||||
* @param array $planIDList
|
||||
* @param string $status
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function batchChangeStatus($planIDList, $status)
|
||||
{
|
||||
$now = helper::now();
|
||||
$allChanges = array();
|
||||
$oldPlans = $this->getByIDList($planIDList, $status);
|
||||
foreach($planIDList as $planID)
|
||||
{
|
||||
$oldPlan = $oldPlans[$planID];
|
||||
if($status == $oldPlan->status) continue;
|
||||
|
||||
$plan = new stdclass();
|
||||
$plan->status = $status;
|
||||
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->where('id')->eq((int)$planID)->exec();
|
||||
if(!dao::isError()) $allChanges[$planID] = common::createChanges($oldPlan, $plan);
|
||||
}
|
||||
return $allChanges;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check date for plan.
|
||||
*
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<?php $vars = "productID=$productID&branch=$branch&browseType=$browseType&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<tr>
|
||||
<th class='c-id'>
|
||||
<?php if(common::hasPriv('productplan', 'batchEdit')):?>
|
||||
<?php if(common::hasPriv('productplan', 'batchEdit') or common::hasPriv('productplan', 'batchChangeStatus')):?>
|
||||
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
|
||||
<label></label>
|
||||
</div>
|
||||
@@ -104,7 +104,7 @@
|
||||
?>
|
||||
<tr class='<?php echo $class;?>'>
|
||||
<td class='cell-id'>
|
||||
<?php if(common::hasPriv('productplan', 'batchEdit')):?>
|
||||
<?php if(common::hasPriv('productplan', 'batchEdit') or common::hasPriv('productplan', 'batchChangeStatus')):?>
|
||||
<?php echo html::checkbox('planIDList', array($plan->id => ''), '', $attribute) . html::a(helper::createLink('productplan', 'view', "planID=$plan->id"), sprintf('%03d', $plan->id));?>
|
||||
<?php else:?>
|
||||
<?php echo sprintf('%03d', $plan->id);?>
|
||||
@@ -211,12 +211,27 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="table-footer">
|
||||
<?php if(common::hasPriv('productplan', 'batchEdit')):?>
|
||||
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
|
||||
<div class="table-actions btn-toolbar">
|
||||
<?php echo html::submitButton($lang->edit, '', 'btn');?>
|
||||
</div>
|
||||
<?php if(common::hasPriv('productplan', 'batchEdit')):?>
|
||||
<?php $actionLink = $this->inlink('batchEdit', "productID=$product->id&branch=$branch");?>
|
||||
<?php echo html::commonButton($lang->edit, "data-form-action='$actionLink'");?>
|
||||
<?php endif;?>
|
||||
<?php if(common::hasPriv('productplan', 'batchChangeStatus')):?>
|
||||
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->productplan->planStatus;?> <span class="caret"></span></button>
|
||||
<div class="dropdown-menu search-list">
|
||||
<div class="list-group">
|
||||
<?php
|
||||
foreach($lang->productplan->statusList as $key => $status)
|
||||
{
|
||||
$actionLink = $this->createLink('productplan', 'batchChangeStatus', "status=$key");
|
||||
echo html::a('javascript:;', $status, '', "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user