Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -9,11 +9,10 @@
|
||||
.board-item + .board-item {margin-top: 10px;}
|
||||
|
||||
#kanban {overflow-y: auto;}
|
||||
#kanban tbody > tr > td {line-height: 24px;}
|
||||
#kanban tbody > tr > td {border-bottom: 2px solid #fff !important;}
|
||||
#kanban thead > tr > th:not(:last-child) {border-right: 2px solid #efefef;}
|
||||
#kanban tbody > tr > td.color-my {background-color: #FFEDED; border-bottom: 5px solid #fff !important;}
|
||||
#kanban tbody > tr > td.color-project {background-color: #F5F5F5;}
|
||||
#kanban tbody > tr > td {line-height: 24px;}
|
||||
#kanban tbody > tr > td {background-color: #F5F5F5;}
|
||||
#kanban tbody > tr:not(:last-child) {border-bottom: 5px solid #fff !important;}
|
||||
|
||||
.s-doing .table-row .table-col:last-child, .c-progress {width: 30px;}
|
||||
.table-row .table-col:first-child {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
|
||||
@@ -354,6 +354,11 @@ class executionModel extends model
|
||||
$this->lang->project->name = $this->lang->execution->name;
|
||||
$this->lang->project->code = $this->lang->execution->code;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->lang->project->name = $this->lang->execution->execName;
|
||||
$this->lang->project->code = $this->lang->execution->execCode;
|
||||
}
|
||||
|
||||
$this->dao->insert(TABLE_EXECUTION)->data($sprint)
|
||||
->autoCheck($skipFields = 'begin,end')
|
||||
@@ -361,7 +366,7 @@ class executionModel extends model
|
||||
->checkIF($sprint->begin != '', 'begin', 'date')
|
||||
->checkIF($sprint->end != '', 'end', 'date')
|
||||
->checkIF($sprint->end != '', 'end', 'ge', $sprint->begin)
|
||||
->checkIF(!empty($sprint->code), 'code', 'unique')
|
||||
->checkIF(!empty($sprint->code), 'code', 'unique', "type in ('sprint','stage')")
|
||||
->exec();
|
||||
|
||||
/* Add the creater to the team. */
|
||||
@@ -499,6 +504,7 @@ class executionModel extends model
|
||||
foreach(explode(',', $this->config->execution->edit->requiredFields) as $field)
|
||||
{
|
||||
if(isset($this->lang->execution->$field)) $this->lang->project->$field = $this->lang->execution->$field;
|
||||
if($oldExecution->type == 'stage' and $field == 'name') $this->lang->project->name = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->project->name);
|
||||
}
|
||||
|
||||
/* Update data. */
|
||||
@@ -508,7 +514,7 @@ class executionModel extends model
|
||||
->checkIF($execution->begin != '', 'begin', 'date')
|
||||
->checkIF($execution->end != '', 'end', 'date')
|
||||
->checkIF($execution->end != '', 'end', 'ge', $execution->begin)
|
||||
->check('code', 'unique', "id != $executionID and code != '' and deleted = '0'")
|
||||
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage')")
|
||||
->where('id')->eq($executionID)
|
||||
->limit(1)
|
||||
->exec();
|
||||
@@ -639,7 +645,7 @@ class executionModel extends model
|
||||
->checkIF($execution->begin != '', 'begin', 'date')
|
||||
->checkIF($execution->end != '', 'end', 'date')
|
||||
->checkIF($execution->end != '', 'end', 'gt', $execution->begin)
|
||||
->checkIF($execution->code != '', 'code', 'unique', "id NOT " . helper::dbIN($data->executionIDList) . " and deleted='0'")
|
||||
->checkIF(!empty($execution->code), 'code', 'unique', "id NOT " . helper::dbIN($data->executionIDList) . " and type in ('sprint','stage')")
|
||||
->where('id')->eq($executionID)
|
||||
->limit(1)
|
||||
->exec();
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<?php $rowIndex = 0;?>
|
||||
<?php foreach($kanbanGroup as $projectID => $executionList):?>
|
||||
<tr>
|
||||
<td class="board-project <?php echo empty($projectID) ? 'color-my' : 'color-project';?>">
|
||||
<td class='board-project'>
|
||||
<div data-id='<?php echo $projectID;?>'>
|
||||
<div class='text-center text-ellipsis'>
|
||||
<?php $projectTitle = empty($projectID) ? $lang->execution->myExecutions : zget($projects, $projectID);?>
|
||||
@@ -38,7 +38,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="c-boards no-padding text-left <?php echo empty($projectID) ? 'color-my' : 'color-project';?>" colspan='4'>
|
||||
<td class='c-boards no-padding text-left' colspan='4'>
|
||||
<div class="boards-wrapper">
|
||||
<div class="boards">
|
||||
<?php foreach($lang->execution->kanbanColType as $colStatus => $colName):?>
|
||||
|
||||
+18
-8
@@ -73,17 +73,16 @@ class myModel extends model
|
||||
->leftJoin(TABLE_PROGRAM)->alias('t2')->on('t1.program = t2.id')
|
||||
->where('t1.deleted')->eq(0)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->products)->fi()
|
||||
->andWhere('t1.PO')->eq($this->app->user->account)
|
||||
->orderBy('t1.order_asc')
|
||||
->fetchAll('id');
|
||||
$productKeys = array_keys($products);
|
||||
|
||||
$stories = $this->dao->select('product, status, count(status) AS count')
|
||||
$stories = $this->dao->select('product, sum(estimate) AS estimateCount')
|
||||
->from(TABLE_STORY)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('product')->in($productKeys)
|
||||
->groupBy('product, status')
|
||||
->fetchGroup('product', 'status');
|
||||
->groupBy('product')
|
||||
->fetchPairs();
|
||||
$plans = $this->dao->select('product, count(*) AS count')
|
||||
->from(TABLE_PRODUCTPLAN)
|
||||
->where('deleted')->eq(0)
|
||||
@@ -112,15 +111,19 @@ class myModel extends model
|
||||
|
||||
foreach($products as $key => $product)
|
||||
{
|
||||
$product->plans = isset($plans[$product->id]) ? $plans[$product->id] : 0;
|
||||
$product->releases = isset($releases[$product->id]) ? $releases[$product->id] : 0;
|
||||
if(isset($stories[$product->id])) $product->stories = $stories[$product->id];
|
||||
$product->plans = isset($plans[$product->id]) ? $plans[$product->id] : 0;
|
||||
$product->releases = isset($releases[$product->id]) ? $releases[$product->id] : 0;
|
||||
$product->storyCount = isset($stories[$product->id]) ? $stories[$product->id] : 0;
|
||||
if(isset($executions[$product->id])) $product->executions = $executions[$product->id];
|
||||
$countAll++;
|
||||
if($product->status != 'closed') $countUnclosed++;
|
||||
if($product->status == 'closed') unset($products[$key]);
|
||||
}
|
||||
|
||||
/* Sort by storyCount,get five record */
|
||||
array_multisort(array_column($products, 'storyCount'), SORT_DESC, $products);
|
||||
$products = array_slice($products, 0, 5);
|
||||
|
||||
$data->count_all = $countAll;
|
||||
$data->count_unclosed = $countUnclosed;
|
||||
$data->products = array_values($products);
|
||||
@@ -136,16 +139,18 @@ class myModel extends model
|
||||
public function getProjects()
|
||||
{
|
||||
$data = new stdClass();
|
||||
$countDoing = 0;
|
||||
$consumedAll = 0;
|
||||
$consumedThisYear = 0;
|
||||
$doingProjects = array();
|
||||
|
||||
$projects = $this->loadModel('project')->getOverviewList('byStatus', 'all', 'order_asc');
|
||||
$projects = $this->loadModel('project')->getOverviewList('byStatus', 'all', 'id_desc');
|
||||
$projectsConsumed = $this->project->getProjectsConsumed(array_keys($projects), 'this_year');
|
||||
foreach($projects as $key => $project)
|
||||
{
|
||||
if($project->status == 'doing')
|
||||
{
|
||||
$countDoing++;
|
||||
$workhour = $this->project->getWorkhour($project->id);
|
||||
$projects[$key]->progress = ($workhour->totalConsumed + $workhour->totalLeft) ? floor($workhour->totalConsumed / ($workhour->totalConsumed + $workhour->totalLeft) * 1000) / 1000 * 100 : 0;
|
||||
$doingProjects[] = $projects[$key];
|
||||
@@ -154,7 +159,12 @@ class myModel extends model
|
||||
$consumedThisYear += $projectsConsumed[$project->id]->totalConsumed;
|
||||
}
|
||||
|
||||
/* Sort by consumed,get five record */
|
||||
array_multisort(array_column($doingProjects, 'consumed'), SORT_DESC, $doingProjects);
|
||||
$doingProjects = array_slice($doingProjects, 0, 5);
|
||||
|
||||
$data->count_all = count($projects);
|
||||
$data->count_doing = $countDoing;
|
||||
$data->consumed_all = $consumedAll;
|
||||
$data->consumed_this_year = $consumedThisYear;
|
||||
$data->projects = $doingProjects;
|
||||
|
||||
@@ -85,8 +85,8 @@ $config->product->search['params']['lastEditedDate'] = array('operator' => '=',
|
||||
|
||||
$config->product->create = new stdclass();
|
||||
$config->product->edit = new stdclass();
|
||||
$config->product->create->requiredFields = 'name';
|
||||
$config->product->edit->requiredFields = 'name';
|
||||
$config->product->create->requiredFields = 'name,code';
|
||||
$config->product->edit->requiredFields = 'name,code';
|
||||
|
||||
$config->product->editor = new stdclass();
|
||||
$config->product->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
|
||||
@@ -555,7 +555,7 @@ class productModel extends model
|
||||
$this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck()
|
||||
->batchCheck($this->config->product->create->requiredFields, 'notempty')
|
||||
->checkIF(!empty($product->name), 'name', 'unique')
|
||||
->checkIF(!empty($product->name), 'code', 'unique')
|
||||
->checkIF(!empty($product->code), 'code', 'unique')
|
||||
->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
@@ -625,8 +625,8 @@ class productModel extends model
|
||||
$product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->edit['id'], $this->post->uid);
|
||||
$this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck()
|
||||
->batchCheck($this->config->product->edit->requiredFields, 'notempty')
|
||||
->checkIF(!empty($product->code), 'code', 'unique', "id != $productID")
|
||||
->check('name', 'unique', "id != $productID and deleted = '0'")
|
||||
->check('code', 'unique', "id != $productID and deleted = '0'")
|
||||
->where('id')->eq($productID)
|
||||
->exec();
|
||||
|
||||
|
||||
@@ -52,6 +52,10 @@
|
||||
<th><?php echo $lang->product->name;?></th>
|
||||
<td><?php echo html::input('name', '', "class='form-control input-product-title' required");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->code;?></th>
|
||||
<td><?php echo html::input('code', '', "class='form-control' required");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->PO;?></th>
|
||||
<td><?php echo html::select('PO', $poUsers, $this->app->user->account, "class='form-control chosen'");?></td><td></td>
|
||||
|
||||
@@ -48,6 +48,10 @@
|
||||
<th class='w-140px'><?php echo $lang->product->name;?></th>
|
||||
<td class='w-p40-f'><?php echo html::input('name', $product->name, "class='form-control' required");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->code;?></th>
|
||||
<td><?php echo html::input('code', $product->code, "class='form-control' required");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->PO;?></th>
|
||||
<td><?php echo html::select('PO', $poUsers, $product->PO, "class='form-control chosen'");?></td><td></td>
|
||||
|
||||
@@ -802,6 +802,7 @@ class projectModel extends model
|
||||
$this->dao->insert(TABLE_PROJECT)->data($project)
|
||||
->autoCheck()
|
||||
->batchcheck($requiredFields, 'notempty')
|
||||
->checkIF(!empty($project->code), 'code', 'unique', "type='project'")
|
||||
->check('name', 'unique', "type='project' AND deleted='0'")
|
||||
->exec();
|
||||
|
||||
@@ -993,6 +994,7 @@ class projectModel extends model
|
||||
->checkIF($project->begin != '', 'begin', 'date')
|
||||
->checkIF($project->end != '', 'end', 'date')
|
||||
->checkIF($project->end != '', 'end', 'gt', $project->begin)
|
||||
->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and type='project'")
|
||||
->check('name', 'unique', "id != $projectID AND type='project' AND deleted='0'")
|
||||
->where('id')->eq($projectID)
|
||||
->exec();
|
||||
|
||||
@@ -41,7 +41,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->name;?></th>
|
||||
<td class="col-main"><?php echo html::input('name', $name, "class='form-control' required");?></td><td></td><td></td>
|
||||
<td class="col-main"><?php echo html::input('name', $name, "class='form-control' required");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->code;?></th>
|
||||
<td><?php echo html::input('code', '', "class='form-control' required");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->PM;?></th>
|
||||
|
||||
@@ -42,12 +42,15 @@
|
||||
}
|
||||
?>
|
||||
<td><?php echo html::select('parent', $programList, $project->parent, "class='form-control chosen' $attr");?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td colspan='2'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->name;?></th>
|
||||
<td class="col-main"><?php echo html::input('name', $project->name, "class='form-control' required");?></td><td></td><td></td>
|
||||
<td class="col-main"><?php echo html::input('name', $project->name, "class='form-control' required");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->code;?></th>
|
||||
<td><?php echo html::input('code', $project->code, "class='form-control' required");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->PM;?></th>
|
||||
|
||||
@@ -45,6 +45,7 @@ a.showMoreImage:hover {opacity: 1;}
|
||||
|
||||
#userMenu>ul>li {margin-right: 10px;}
|
||||
#userNav .dropdown-menu>li>a>.icon-w {top: 2px;}
|
||||
#globalCreate .dropdown-menu {z-index: 2000;}
|
||||
.icon-plus-solid-circle:before {font-size: 30px; color: #3b92f7;}
|
||||
.create-list {min-width: 120px !important;}
|
||||
.create-list>li>a {padding-left: 35px !important;}
|
||||
|
||||
Reference in New Issue
Block a user