Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
leiyong
2020-11-24 23:22:27 +08:00
6 changed files with 43 additions and 38 deletions
+1 -1
View File
@@ -237,7 +237,7 @@ $(function()
$('#dashboard').sortable(
{
selector: '.panel',
trigger: '.panel-heading,.panel-move-handler',
trigger: '.panel-heading:not(.not-move-handler),.panel-move-handler',
containerSelector: '.col-main,.col-side',
start: function()
{
+11 -9
View File
@@ -1,17 +1,19 @@
<style>
#cards {margin: 0 10px;}
.cards-menu > li > a {padding-left: 5px; text-align: left;}
.cards-menu > li > a > i {opacity: .5; display: inline-block; margin-right: 4px; width: 18px; text-align: center;}
.cards-menu > li > a:hover > i {opacity: 1;}
#cards {margin: 0; padding: 0 10px 10px 10px;}
#cards > .col {width: 33.33%;}
.col-side #cards > .col {width: 100%;}
#cards .panel {margin: 10px 0; border: 1px solid #DCDCDC; border-radius: 2px; box-shadow: none; height: 146px; cursor: pointer;}
#cards .panel:hover {border-color: #006AF1; box-shadow: 0 0 10px 0 rgba(0,0,100,.25);}
#cards .panel-heading {padding: 12px 24px 10px 16px;}
#cards .panel-body {padding: 0 16px 16px;}
#cards .panel-actions {padding: 7px 0; z-index: 0}
#cards .panel-actions .dropdown-menu > li > a {padding-left: 5px; text-align: left;}
#cards .panel-actions .dropdown-menu > li > a > i {opacity: .5; display: inline-block; margin-right: 4px; width: 18px; text-align: center;}
#cards .panel-actions .dropdown-menu > li > a:hover > i {opacity: 1;}
#cards .project-type-label {padding: 1px 2px;}
#cards .project-name {font-size: 16px; font-weight: normal; display: inline-block; max-width: 75%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;}
#cards .project-infos {font-size: 12px;}
#cards .project-infos {font-size: 12px; padding: 0 15px;}
#cards .project-infos > span {display: inline-block; line-height: 12px;}
#cards .project-infos > span > .icon {font-size: 12px; display: inline-block; position: relative; top: -1px}
#cards .project-infos > span + span {margin-left: 10px;}
@@ -29,14 +31,14 @@
#cards .project-stage-item + .project-stage-item:after {content: ' '; display: block; left: -50%; right: 50%; height: 2px; background-color: #D1D1D1; top: 3px; position: absolute; z-index: 0;}
#cards .project-stage-item.is-going {color: #333;}
#cards .project-stage-item.is-going::before {background-color: #0C64EB;}
.block-recentproject .panel-body{padding: 0;}
#dashboard .block-recentproject .panel-body {padding: 0;}
</style>
<div class="panel-body">
<div class='row' id='cards'>
<?php foreach ($projects as $projectID => $project):?>
<div class='col' data-id='<?php echo $projectID?>'>
<div class='panel' data-url='<?php echo $this->createLink('project', 'index', "projectID=$project->id");?>'>
<div class='panel-heading'>
<div class='panel-heading not-move-handler'>
<strong class='project-name' title='<?php echo $project->name;?>'> <?php echo html::a($this->createLink('project', 'index', "projectID=$project->id", '', '', $project->id), $project->name);?> </strong>
<?php if($project->model === 'waterfall'): ?>
<span class='project-type-label label label-warning label-outline'><?php echo $lang->program->waterfall; ?></span>
@@ -45,8 +47,8 @@
<?php endif; ?>
<nav class='panel-actions nav nav-default'>
<li class='dropdown'>
<a href='javascript:;' data-toggle='dropdown' class='panel-action'><i class='icon icon-ellipsis-v'></i></a>
<ul class='dropdown-menu pull-right'>
<a href='javascript:;' data-toggle='context-dropdown' class='panel-action'><i class='icon icon-ellipsis-v'></i></a>
<ul class='dropdown-menu pull-right cards-menu'>
<li><?php common::printIcon('program', 'PRJGroup', "projectID=$project->id", $project, 'button', 'group');?></li>
<li><?php common::printIcon('program', 'PRJManageMembers', "projectID=$project->id", $project, 'button', 'persons');?></li>
<li><?php common::printicon('program', 'PRJActivate', "projectid=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
+1 -1
View File
@@ -534,7 +534,7 @@ class programModel extends model
if(empty($program)) return true;
if(!isset($program->type)) return true;
if($program->type == 'program' && ($action == 'prjstart' || $action == 'prjsuspend')) return false;
if($program->type == 'program' && $action == 'prjsuspend') return false;
if($action == 'pgmclose') return $program->status != 'closed';
if($action == 'pgmactivate') return $program->status == 'done' or $program->status == 'closed';
+6
View File
@@ -157,6 +157,12 @@ else
</tr>
<?php endif;?>
<?php $this->printExtendFields('', 'table');?>
<tr>
<th><?php echo $lang->program->PRJStoryConcept;?></th>
<td>
<?php echo html::select('storyConcept', $lang->custom->URSRList, zget($config->custom, 'URSRName', 1), "class='form-control chosen'");?>
</td>
</tr>
<tr>
<th><?php echo $lang->program->PRJDesc;?></th>
<td colspan='3'>
+18 -21
View File
@@ -955,31 +955,27 @@ class projectModel extends model
*/
public function getExecutionStats($projectID = 0, $status = 'undone', $productID = 0, $branch = 0, $itemCounts = 30, $orderBy = 'order_desc', $pager = null)
{
/* Init vars. */
$executions = $this->getExecutionList($projectID, $status, 0, $productID, $branch);
$executions = $this->dao->select('*')->from(TABLE_EXECUTION)
->where('id')->in(array_keys($executions))
->andWhere('grade')->eq(1)
->andWhere('deleted')->eq('0')
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
if(empty($executions)) return array();
/* In case of a waterfall model, obtain sub-stage data. */
$project = $this->loadModel('program')->getPRJById($this->session->PRJ);
if($project and $project->model == 'waterfall')
if(empty($productID))
{
$childrens = $this->dao->select('*')->from(TABLE_PROJECT)
->where('parent')->in(array_keys($executions))
->andWhere('grade')->eq(2)
$executions = $this->dao->select('*')->from(TABLE_EXECUTION)
->where('project')->eq($projectID)
->andWhere('type')->eq('stage')
->andWhere('deleted')->eq('0')
->orderBy($orderBy)
->orderBy('path_desc,id_asc')
->page($pager)
->fetchAll('id');
}
else
{
$executions = $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project=t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.project')->eq($projectID)
->andWhere('t2.type')->eq('stage')
->andWhere('t2.deleted')->eq('0')
->orderBy('t2.parent_desc,t2.id_asc')
->page($pager)
->fetchAll('id');
$executions += $childrens;
}
$hours = array();
@@ -1074,6 +1070,7 @@ class projectModel extends model
}
/* In the case of the waterfall model, calculate the sub-stage. */
$project = $this->loadModel('program')->getPRJById($this->session->PRJ);
if($project and $project->model == 'waterfall')
{
foreach($parents as $id => $execution) $execution->children = isset($children[$id]) ? $children[$id] : array();
+6 -6
View File
File diff suppressed because one or more lines are too long