* Finish task #8783.
This commit is contained in:
@@ -802,6 +802,26 @@ class productModel extends model
|
||||
$this->loadModel('search')->setSearchParams($this->config->product->search);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projects by product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getProjectPairsByProduct($productID, $branch = 0)
|
||||
{
|
||||
return $this->dao->select('t2.id,t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
->where('t1.product')->eq($productID)
|
||||
->andWhere('t2.type')->eq('project')
|
||||
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi()
|
||||
->andWhere('t2.deleted')->eq('0')
|
||||
->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get executions by product and project.
|
||||
*
|
||||
|
||||
@@ -208,6 +208,7 @@ class productplan extends control
|
||||
public function browse($productID = 0, $branch = 0, $browseType = 'all', $orderBy = 'begin_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1 )
|
||||
{
|
||||
$this->app->loadLang('project');
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
@@ -226,6 +227,7 @@ class productplan extends control
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->plans = $this->productplan->getList($productID, $branch, $browseType, $pager, $sort);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->projects = $this->product->getProjectPairsByProduct($productID, $branch);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,14 @@ $(function()
|
||||
$content.append("<a href='###' class='more'><i class='icon icon-chevron-double-down'></i></a>");
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$('#createExecutionButton').on('click', function()
|
||||
{
|
||||
var PRJID = $('#project').val();
|
||||
var planID = $('#planID').val();
|
||||
parent.location.href = createLink('project', 'create', 'productID=' + productID + '&projectID=©ProjectID=&planID=' + planID + '&confirm=&PRJID=' + PRJID);
|
||||
});
|
||||
});
|
||||
$(document).on('click', 'td.content .more', function(e)
|
||||
{
|
||||
var $toggle = $(this);
|
||||
@@ -38,3 +45,16 @@ $(document).on('click', 'td.content .more', function(e)
|
||||
$toggle.find('i').removeClass('icon-chevron-double-down').addClass('icon-chevron-double-up');
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Get planID
|
||||
*
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function getPlanID(obj)
|
||||
{
|
||||
var planID = $(obj).attr("data-id")
|
||||
$('#planID').val(planID);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ $lang->productplan->view = "Details";
|
||||
$lang->productplan->bugSummary = "<strong>%s</strong> Bugs auf dieser Seite";
|
||||
$lang->productplan->basicInfo = 'Basis Info';
|
||||
$lang->productplan->batchEdit = 'Mehrere bearbeiten';
|
||||
$lang->productplan->project = 'Project';
|
||||
|
||||
$lang->productplan->batchUnlink = "Mehere Verknüpfungen aufheben";
|
||||
$lang->productplan->linkStory = "Story verknüpfen";
|
||||
@@ -43,6 +44,8 @@ $lang->productplan->confirmUnlinkStory = "Möchten Sie diese Story löschen?";
|
||||
$lang->productplan->confirmUnlinkBug = "Möchten Sie diesen Bug löschen?";
|
||||
$lang->productplan->noPlan = 'Kein Plan. ';
|
||||
$lang->productplan->cannotDeleteParent = 'Cannot delete parent plan';
|
||||
$lang->productplan->selectProjects = "Please select the project";
|
||||
$lang->productplan->nextStep = "Next step";
|
||||
|
||||
$lang->productplan->id = 'ID';
|
||||
$lang->productplan->product = $lang->productCommon;
|
||||
@@ -56,7 +59,7 @@ $lang->productplan->future = 'Wartend';
|
||||
$lang->productplan->stories = 'Storys';
|
||||
$lang->productplan->bugs = 'Bugs';
|
||||
$lang->productplan->hour = $lang->hourCommon;
|
||||
$lang->productplan->project = $lang->executionCommon;
|
||||
$lang->productplan->execution = $lang->executionCommon;
|
||||
$lang->productplan->parent = "Parent Plan";
|
||||
$lang->productplan->parentAB = "Parent";
|
||||
$lang->productplan->children = "Child Plan";
|
||||
|
||||
@@ -19,6 +19,7 @@ $lang->productplan->view = "Plan Detail";
|
||||
$lang->productplan->bugSummary = "Total <strong>%s</strong> Bugs on this page.";
|
||||
$lang->productplan->basicInfo = 'Basic Info';
|
||||
$lang->productplan->batchEdit = 'Batch Edit';
|
||||
$lang->productplan->project = 'Project';
|
||||
|
||||
$lang->productplan->batchUnlink = "Batch Unlink";
|
||||
$lang->productplan->linkStory = "Link Story";
|
||||
@@ -43,6 +44,8 @@ $lang->productplan->confirmUnlinkStory = "Do you want to unlink this story?";
|
||||
$lang->productplan->confirmUnlinkBug = "Do you want to unlink this bug?";
|
||||
$lang->productplan->noPlan = 'No plans yet. ';
|
||||
$lang->productplan->cannotDeleteParent = 'Cannot delete parent plan';
|
||||
$lang->productplan->selectProjects = "Please select the project";
|
||||
$lang->productplan->nextStep = "Next step";
|
||||
|
||||
$lang->productplan->id = 'ID';
|
||||
$lang->productplan->product = $lang->productCommon;
|
||||
@@ -56,7 +59,7 @@ $lang->productplan->future = 'TBD';
|
||||
$lang->productplan->stories = 'Story';
|
||||
$lang->productplan->bugs = 'Bug';
|
||||
$lang->productplan->hour = $lang->hourCommon;
|
||||
$lang->productplan->project = $lang->executionCommon;
|
||||
$lang->productplan->execution = $lang->executionCommon;
|
||||
$lang->productplan->parent = "Parent Plan";
|
||||
$lang->productplan->parentAB = "Parent";
|
||||
$lang->productplan->children = "Child Plan";
|
||||
|
||||
@@ -19,6 +19,7 @@ $lang->productplan->view = "Détail Plan";
|
||||
$lang->productplan->bugSummary = "Total <strong>%s</strong> Bugs sur cette page.";
|
||||
$lang->productplan->basicInfo = 'Infos de Base';
|
||||
$lang->productplan->batchEdit = 'Edition par Lot';
|
||||
$lang->productplan->project = 'Project';
|
||||
|
||||
$lang->productplan->batchUnlink = "Retirer par lot";
|
||||
$lang->productplan->linkStory = "Planifier Story";
|
||||
@@ -43,6 +44,8 @@ $lang->productplan->confirmUnlinkStory = "Voulez-vous détacher cette Story du P
|
||||
$lang->productplan->confirmUnlinkBug = "Voulez-vous retirer ce bug du plan ?";
|
||||
$lang->productplan->noPlan = "Aucun plan pour l'instant. ";
|
||||
$lang->productplan->cannotDeleteParent = 'Impossible de supprimer le plan parent';
|
||||
$lang->productplan->selectProjects = "Please select the project";
|
||||
$lang->productplan->nextStep = "Next step";
|
||||
|
||||
$lang->productplan->id = 'ID';
|
||||
$lang->productplan->product = $lang->productCommon;
|
||||
@@ -56,7 +59,7 @@ $lang->productplan->future = 'A Définir';
|
||||
$lang->productplan->stories = 'Story';
|
||||
$lang->productplan->bugs = 'Bug';
|
||||
$lang->productplan->hour = $lang->hourCommon;
|
||||
$lang->productplan->project = $lang->executionCommon;
|
||||
$lang->productplan->execution = $lang->executionCommon;
|
||||
$lang->productplan->parent = "Plan Parent";
|
||||
$lang->productplan->parentAB = "Parent";
|
||||
$lang->productplan->children = "Sous-Plan";
|
||||
|
||||
@@ -19,6 +19,7 @@ $lang->productplan->view = "Chi tiết kế hoạch";
|
||||
$lang->productplan->bugSummary = "Tổng <strong>%s</strong> Bugs trên trang này.";
|
||||
$lang->productplan->basicInfo = 'Thông tin cơ bản';
|
||||
$lang->productplan->batchEdit = 'Sửa hàng loạt';
|
||||
$lang->productplan->project = 'Project';
|
||||
|
||||
$lang->productplan->batchUnlink = "Hủy liên kết hàng loạt";
|
||||
$lang->productplan->linkStory = "Liên kết câu chuyện";
|
||||
@@ -43,6 +44,8 @@ $lang->productplan->confirmUnlinkStory = "Bạn có muốn hủy liên kết câ
|
||||
$lang->productplan->confirmUnlinkBug = "Bạn có muốn hủy liên kết bug này?";
|
||||
$lang->productplan->noPlan = 'Không có kế hoạch nào';
|
||||
$lang->productplan->cannotDeleteParent = 'Không thể xóa kế hoạch mẹ';
|
||||
$lang->productplan->selectProjects = "Please select the project";
|
||||
$lang->productplan->nextStep = "Next step";
|
||||
|
||||
$lang->productplan->id = 'ID';
|
||||
$lang->productplan->product = $lang->productCommon;
|
||||
@@ -56,7 +59,7 @@ $lang->productplan->future = 'TBD';
|
||||
$lang->productplan->stories = 'Câu chuyện';
|
||||
$lang->productplan->bugs = 'Bug';
|
||||
$lang->productplan->hour = $lang->hourCommon;
|
||||
$lang->productplan->project = $lang->executionCommon;
|
||||
$lang->productplan->execution = $lang->executionCommon;
|
||||
$lang->productplan->parent = "Kế hoạch mẹ";
|
||||
$lang->productplan->parentAB = "Mẹ";
|
||||
$lang->productplan->children = "Kế hoạch con";
|
||||
|
||||
@@ -19,6 +19,7 @@ $lang->productplan->view = "计划详情";
|
||||
$lang->productplan->bugSummary = "本页共 <strong>%s</strong> 个Bug";
|
||||
$lang->productplan->basicInfo = '基本信息';
|
||||
$lang->productplan->batchEdit = '批量编辑';
|
||||
$lang->productplan->project = '项目';
|
||||
|
||||
$lang->productplan->batchUnlink = "批量移除";
|
||||
$lang->productplan->linkStory = "关联{$lang->productSRCommon}";
|
||||
@@ -43,6 +44,8 @@ $lang->productplan->confirmUnlinkStory = "您确认移除该{$lang->productSRCom
|
||||
$lang->productplan->confirmUnlinkBug = "您确认移除该Bug吗?";
|
||||
$lang->productplan->noPlan = "暂时没有计划。";
|
||||
$lang->productplan->cannotDeleteParent = "不能删除父计划";
|
||||
$lang->productplan->selectProjects = "请选择所属项目";
|
||||
$lang->productplan->nextStep = "下一步";
|
||||
|
||||
$lang->productplan->id = '编号';
|
||||
$lang->productplan->product = $lang->productCommon;
|
||||
@@ -56,7 +59,7 @@ $lang->productplan->future = '待定';
|
||||
$lang->productplan->stories = "{$lang->productSRCommon}数";
|
||||
$lang->productplan->bugs = 'Bug数';
|
||||
$lang->productplan->hour = $lang->hourCommon;
|
||||
$lang->productplan->project = $lang->executionCommon;
|
||||
$lang->productplan->execution = $lang->executionCommon;
|
||||
$lang->productplan->parent = "父计划";
|
||||
$lang->productplan->parentAB = "父";
|
||||
$lang->productplan->children = "子计划";
|
||||
|
||||
@@ -56,7 +56,7 @@ $lang->productplan->future = '待定';
|
||||
$lang->productplan->stories = "{$lang->productSRCommon}數";
|
||||
$lang->productplan->bugs = 'Bug數';
|
||||
$lang->productplan->hour = $lang->hourCommon;
|
||||
$lang->productplan->project = $lang->executionCommon;
|
||||
$lang->productplan->execution = $lang->executionCommon;
|
||||
$lang->productplan->parent = "父計劃";
|
||||
$lang->productplan->parentAB = "父";
|
||||
$lang->productplan->children = "子計劃";
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('confirmDelete', $lang->productplan->confirmDelete)?>
|
||||
<?php js::set('browseType', $browseType);?>
|
||||
<?php js::set('productID', $productID);?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php foreach(customModel::getFeatureMenu($this->moduleName, $this->methodName) as $menuItem):?>
|
||||
@@ -62,7 +63,7 @@
|
||||
<th class='w-70px'> <?php echo $lang->productplan->stories;?></th>
|
||||
<th class='w-60px'> <?php echo $lang->productplan->bugs;?></th>
|
||||
<th class='w-60px'> <?php echo $lang->productplan->hour;?></th>
|
||||
<th class='w-60px'> <?php echo $lang->productplan->project;?></th>
|
||||
<th class='w-60px'> <?php echo $lang->productplan->execution;?></th>
|
||||
<th> <?php echo $lang->productplan->desc;?></th>
|
||||
<?php
|
||||
$extendFields = $this->productplan->getFlowExtendFields();
|
||||
@@ -127,7 +128,7 @@
|
||||
<?php foreach($extendFields as $extendField) echo "<td>" . $this->loadModel('flow')->getFieldValue($extendField, $plan) . "</td>";?>
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
if(common::hasPriv('project', 'create', $plan)) echo html::a(helper::createLink('project', 'create', "productID=&projectID=©ProjectID=&planID=$plan->id"), '<i class="icon-plus"></i>', '', "class='btn' title='{$lang->project->create}'");
|
||||
if(common::hasPriv('project', 'create', $plan)) echo html::a('#projects', '<i class="icon-plus"></i>', '', "data-toggle='modal' data-id='$plan->id' onclick='getPlanID(this)' class='btn' title='{$lang->project->create}'");
|
||||
if(common::hasPriv('productplan', 'linkStory', $plan) and $plan->parent >= 0) echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), '<i class="icon-link"></i>', '', "class='btn' title='{$lang->productplan->linkStory}'");
|
||||
if(common::hasPriv('productplan', 'linkBug', $plan)) echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), '<i class="icon-bug"></i>', '', "class='btn' title='{$lang->productplan->linkBug}'");
|
||||
common::printIcon('productplan', 'edit', "planID=$plan->id", $plan, 'list');
|
||||
@@ -166,4 +167,28 @@
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class="modal fade" id="projects">
|
||||
<div class="modal-dialog mw-500px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title"><?php echo $lang->productplan->selectProjects;?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->productplan->project?></th>
|
||||
<td><?php echo html::select('projects', $projects, '', "class='form-control chosen' id=project");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='text-center'>
|
||||
<?php echo html::hidden('planID', '');?>
|
||||
<?php echo html::commonButton($lang->productplan->nextStep, "id='createExecutionButton'", 'btn btn-primary btn-wide');?>
|
||||
<?php echo html::commonButton($lang->cancel, "data-dismiss='modal'", 'btn btn-default btn-wide');?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -1081,8 +1081,9 @@ class project extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($productID = '', $projectID = '', $copyProjectID = '', $planID = 0, $confirm = 'no')
|
||||
public function create($productID = '', $projectID = '', $copyProjectID = '', $planID = 0, $confirm = 'no', $PRJID = 0)
|
||||
{
|
||||
if($PRJID) $this->session->set('PRJ', $PRJID);
|
||||
$this->app->loadLang('program');
|
||||
$this->app->loadLang('stage');
|
||||
$this->app->loadLang('programplan');
|
||||
|
||||
Reference in New Issue
Block a user