Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -2840,7 +2840,7 @@ class execution extends control
|
||||
|
||||
/* Build the search form. */
|
||||
$actionURL = $this->createLink($this->app->rawModule, 'linkStory', "objectID=$objectID&browseType=bySearch&queryID=myQueryID");
|
||||
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed');
|
||||
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products));
|
||||
$this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'linkStory', $objectID);
|
||||
|
||||
if($browseType == 'bySearch')
|
||||
|
||||
@@ -1136,10 +1136,11 @@ class executionModel extends model
|
||||
* @param int $limit
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($projectID = 0, $type = 'all', $status = 'all', $limit = 0, $productID = 0, $branch = 0)
|
||||
public function getList($projectID = 0, $type = 'all', $status = 'all', $limit = 0, $productID = 0, $branch = 0, $pager = null)
|
||||
{
|
||||
if($status == 'involved') return $this->getInvolvedExecutionList($projectID, $status, $limit, $productID, $branch);
|
||||
|
||||
@@ -1157,6 +1158,7 @@ class executionModel extends model
|
||||
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
|
||||
->orderBy('order_desc')
|
||||
->page($pager)
|
||||
->beginIF($limit)->limit($limit)->fi()
|
||||
->fetchAll('id');
|
||||
}
|
||||
@@ -1172,6 +1174,7 @@ class executionModel extends model
|
||||
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
|
||||
->orderBy('order_desc')
|
||||
->page($pager)
|
||||
->beginIF($limit)->limit($limit)->fi()
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ class project extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index($projectID = 0, $browseType = 'all')
|
||||
public function index($projectID = 0, $browseType = 'all', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$projectID = $this->project->saveState($projectID, $this->project->getPairsByProgram());
|
||||
|
||||
@@ -245,7 +245,11 @@ class project extends control
|
||||
|
||||
if($project->model == 'kanban' and $this->config->vision != 'lite')
|
||||
{
|
||||
$kanbanList = $this->loadModel('execution')->getList($projectID, 'all', $browseType);
|
||||
/* Load pager and get kanban list. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$kanbanList = $this->loadModel('execution')->getList($projectID, 'all', $browseType, 0, 0, 0, $pager);
|
||||
|
||||
$executionActions = array();
|
||||
foreach($kanbanList as $kanbanID => $kanban)
|
||||
@@ -262,6 +266,7 @@ class project extends control
|
||||
$this->view->memberGroup = $this->execution->getMembersByIdList(array_keys($kanbanList));
|
||||
$this->view->usersAvatar = $this->loadModel('user')->getAvatarPairs('all');
|
||||
$this->view->executionActions = $executionActions;
|
||||
$this->view->pager = $pager;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->project->common . $this->lang->colon . $this->lang->project->index;
|
||||
@@ -293,7 +298,7 @@ class project extends control
|
||||
|
||||
$projectType = $this->cookie->projectType ? $this->cookie->projectType : 'bylist';
|
||||
|
||||
/* Load pager and get tasks. */
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
|
||||
@@ -28,3 +28,5 @@
|
||||
.kanbans .kanban-actions .dropdown-menu.pull-left {top:31px; right:-1px; left: auto;}
|
||||
|
||||
.label-doing {background: #ff5d5d}
|
||||
#cardsFooter .pager {margin: 0; float: right;}
|
||||
#cardsFooter .pager .btn {padding-top: 4px; border: none;}
|
||||
|
||||
+12
-10
@@ -227,27 +227,29 @@ class projectModel extends model
|
||||
$project->executions = $this->getStats($projectID, 'undone', 0, 0, 30, $orderBy, $pager);
|
||||
$project->teamCount = isset($teams[$projectID]) ? $teams[$projectID]->count : 0;
|
||||
$project->estimate = isset($estimates[$projectID]) ? round($estimates[$projectID]->estimate, 2) : 0;
|
||||
$project->parentName = $this->getParentName($project->parent);
|
||||
$project->parentName = $this->getParentProgram($project);
|
||||
}
|
||||
return $projects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the top-level project name.
|
||||
* Get all parent program of a program.
|
||||
*
|
||||
* @param int $parentID
|
||||
* @access private
|
||||
* @param int $parentID
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getParentName($parentID = 0)
|
||||
public function getParentProgram($project)
|
||||
{
|
||||
if($parentID == 0) return '';
|
||||
if($project->parent == 0) return '';
|
||||
|
||||
static $parent;
|
||||
$parent = $this->dao->select('id,parent,name')->from(TABLE_PROJECT)->where('id')->eq($parentID)->fetch();
|
||||
if($parent->parent) $this->getParentName($parent->parent);
|
||||
$parentName = $this->dao->select('id,name')->from(TABLE_PROGRAM)->where('id')->in(trim($project->path, ','))->andWhere('grade')->lt($project->grade)->fetchPairs();
|
||||
|
||||
return $parent->name;
|
||||
$parentProgram = '';
|
||||
foreach($parentName as $name) $parentProgram .= $name . '/';
|
||||
$parentProgram = rtrim($parentProgram, '/');
|
||||
|
||||
return $parentProgram;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#cards > .col {width: 25%;}
|
||||
@media screen and (max-width: 1500px) {#cards > .col {width: 33.3333333%;}}
|
||||
#cards .panel {margin: 10px 0; border: 1px solid #DCDCDC; border-radius: 4px; box-shadow: none; cursor: pointer; height: 190px;}
|
||||
#cards .pager .btn {padding-top: 4px;}
|
||||
#cards .panel:hover {border-color: #006AF1; box-shadow: 0 0 10px 0 rgba(0,0,100,.25);}
|
||||
#cards .panel .projectStatus .label{float: right;}
|
||||
#cards .panel-heading {padding: 12px 24px 10px 16px;}
|
||||
@@ -30,8 +29,8 @@
|
||||
#cards .project-infos > .budget {max-width: 75px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
#cards .project-detail {position: absolute; top: 75px; left: 16px; right: 16px; font-size: 12px;}
|
||||
#cards .project-footer {position: absolute; bottom: 10px; right: 10px; left: 15px;}
|
||||
#cards .pager {margin: 0; float: right;}
|
||||
#cards .pager .btn {border: none}
|
||||
#cardsFooter .pager {margin: 0; float: right;}
|
||||
#cardsFooter .pager .btn {border: none; padding-top: 4px;}
|
||||
#cards .panel .label-wait {background: #EFEFEF !important; color: #838A9D;}
|
||||
#cards .panel .label-doing {background: #E9F2FB !important; color: #2B80FF;}
|
||||
#cards .panel .label-suspended {background: #AAA !important; color: #FFF;}
|
||||
|
||||
@@ -120,6 +120,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
<div class='col-xs-12' id='cardsFooter'>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -125,6 +125,7 @@ class projectrelease extends control
|
||||
unset($builds['trunk']);
|
||||
|
||||
$this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->release->create;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->builds = $builds;
|
||||
$this->view->lastRelease = $this->projectrelease->getLast($projectID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed');
|
||||
|
||||
@@ -27,7 +27,7 @@ function loadBranches(productID)
|
||||
{
|
||||
$('#branch').remove();
|
||||
$('#branch_chosen').remove();
|
||||
$.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID + '&oldBranch=0¶ms=active'), function(data)
|
||||
$.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID + '&oldBranch=0¶ms=active&projectID=' + projectID), function(data)
|
||||
{
|
||||
var $product = $('#product');
|
||||
var $inputGroup = $product.closest('.input-group');
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php js::set('confirmLink', $confirmLink);?>
|
||||
<?php js::set('projectID', $projectID);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
|
||||
@@ -670,12 +670,12 @@ class storyModel extends model
|
||||
->add('lastEditedDate', $now)
|
||||
->setIF($specChanged, 'version', $oldStory->version + 1)
|
||||
->setIF($specChanged and $oldStory->status == 'active' and $this->post->needNotReview == false, 'status', 'changed')
|
||||
->setIF($oldStory->status == 'draft' and $this->post->needNotReview, 'status', 'active')
|
||||
->setIF($specChanged, 'reviewedBy', '')
|
||||
->setIF($oldStory->status == 'draft' and $this->post->needNotReview, 'status', 'active')
|
||||
->setIF($specChanged, 'reviewedBy', '')
|
||||
->setIF($specChanged, 'closedBy', '')
|
||||
->setIF($specChanged, 'closedReason', '')
|
||||
->setIF($specChanged and $oldStory->reviewedBy, 'reviewedDate', '0000-00-00')
|
||||
->setIF($specChanged and $oldStory->closedBy, 'closedDate', '0000-00-00')
|
||||
->setIF($specChanged and $oldStory->reviewedBy, 'reviewedDate', '0000-00-00')
|
||||
->setIF($specChanged and $oldStory->closedBy, 'closedDate', '0000-00-00')
|
||||
->stripTags($this->config->story->editor->change['id'], $this->config->allowedTags)
|
||||
->remove('files,labels,reviewer,comment,needNotReview,uid')
|
||||
->get();
|
||||
|
||||
@@ -35,7 +35,11 @@ include '../../common/view/chart.html.php';
|
||||
<td><?php echo $task->estimate;?></td>
|
||||
<td><?php echo $task->consumed;?></td>
|
||||
<td><?php echo $task->left;?></td>
|
||||
<td><div class='progress-pie' title="<?php echo $task->progress?>%" data-value='<?php echo $task->progress;?>'></div></td>
|
||||
<td>
|
||||
<div class='progress-pie' data-doughnut-size='80' data-color='#00DA88' data-value='<?php echo $task->progress?>' data-width='26' data-height='26' data-back-color='#e8edf3'>
|
||||
<div class='progress-info'><?php echo $task->progress;?></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if(!empty($task->children)):?>
|
||||
<?php $i = 0;?>
|
||||
|
||||
@@ -832,6 +832,9 @@ class task extends control
|
||||
return print(js::error($this->lang->notFound) . js::locate($this->createLink('execution', 'all')));
|
||||
}
|
||||
|
||||
$execution = $this->execution->getById($task->execution);
|
||||
if(!isonlybody() and $execution->type == 'kanban') return $this->locate($this->createLink('execution', 'kanban', "executionID=$execution->id"));
|
||||
|
||||
$this->session->project = $task->project;
|
||||
|
||||
if($task->fromBug != 0)
|
||||
@@ -859,7 +862,6 @@ class task extends control
|
||||
if($task->assignedTo == $this->app->user->account) $this->loadModel('action')->read('task', $taskID);
|
||||
|
||||
/* Set menu. */
|
||||
$execution = $this->execution->getById($task->execution);
|
||||
if($this->app->tab == 'execution') $this->execution->setMenu($execution->id);
|
||||
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
@@ -335,7 +335,7 @@ class tree extends control
|
||||
if($showProduct)
|
||||
{
|
||||
$product = $this->loadModel('product')->getById($module->root);
|
||||
if($product->type != 'normal') $this->view->branches = $this->loadModel('branch')->getPairs($module->root);
|
||||
if($product->type != 'normal') $this->view->branches = $this->loadModel('branch')->getPairs($module->root, 'active');
|
||||
$this->view->product = $product;
|
||||
$this->view->products = $this->product->getPairs('', $product->program);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user