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

This commit is contained in:
wangyidong
2018-01-16 15:08:42 +08:00
13 changed files with 45 additions and 25 deletions
+3 -2
View File
@@ -16,8 +16,9 @@
<td>
<table cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5; <?php if(!empty($bug->color)) echo 'color: ' . $bug->color;?>'>
<?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('bug', 'view', "bugID=$bug->id"), $mailTitle, '', "style='color: #333; text-decoration: underline;'");?>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'>
<?php $color = empty($bug->color) ? '#333' : $bug->color;?>
<?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('bug', 'view', "bugID=$bug->id"), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
</td>
</tr>
</table>
+1 -1
View File
@@ -1487,7 +1487,7 @@ class projectModel extends model
{
foreach($plans as $planID => $productID)
{
$planStory = $this->loadModel('story')->getPlanStories($planID);
$planStory = $this->loadModel('story')->getPlanStories($planID, 'active');
if(!empty($planStory))
{
$planStories = array_merge($planStories, array_keys($planStory));
+1 -2
View File
@@ -120,7 +120,7 @@ class report extends control
* @access public
* @return void
*/
public function workload($begin = '', $end = '', $days = 0, $workday = 0, $dept = 0, $assign = 1)
public function workload($begin = '', $end = '', $days = 0, $workday = 0, $dept = 0, $assign = 'assign')
{
if($_POST)
{
@@ -140,7 +140,6 @@ class report extends control
$beginWeekDay = date('w', $begin);
$begin = date('Y-m-d', $begin);
$end = date('Y-m-d', $end);
$assign = empty($assign) ? 0 : 1;
if(empty($workday))$workday = $this->config->project->defaultWorkhours;
$diffDays = helper::diffDate($end, $begin);
+2 -2
View File
@@ -18,7 +18,7 @@ function changeParams(obj)
{
var beginarray = begin.split("-");
var begin = '';
for(i=0 ; i < beginarray.length ; i++) begin = begin + beginarray[i];
for(i = 0; i < beginarray.length; i++) begin = begin + beginarray[i];
}
if(end.indexOf('-') != -1)
{
@@ -27,7 +27,7 @@ function changeParams(obj)
for(i=0 ; i < endarray.length ; i++) end = end + endarray[i];
}
link = createLink('report', 'workload', 'begin=' + begin + '&end=' + end + '&days=' + days + '&workday=' + workday + '&dept=' + dept + '&assign=' + assign);
var link = createLink('report', 'workload', 'begin=' + begin + '&end=' + end + '&days=' + days + '&workday=' + workday + '&dept=' + dept + '&assign=' + assign);
location.href=link;
}
+2 -2
View File
@@ -31,8 +31,8 @@ $lang->report->colors[] = '008ED6';
$lang->report->colors[] = '9D080D';
$lang->report->colors[] = 'A186BE';
$lang->report->isAssign[0] = 'Not assigned';
$lang->report->isAssign[1] = 'Assigned';
$lang->report->assign['noassign'] = 'Not assigned';
$lang->report->assign['assign'] = 'Assigned';
$lang->report->singleColor[] = 'F6BD0F';
+2 -2
View File
@@ -31,8 +31,8 @@ $lang->report->colors[] = '008ED6';
$lang->report->colors[] = '9D080D';
$lang->report->colors[] = 'A186BE';
$lang->report->isAssign[0] = '未指派';
$lang->report->isAssign[1] = '已指派';
$lang->report->assign['noassign'] = '未指派';
$lang->report->assign['assign'] = '已指派';
$lang->report->singleColor[] = 'F6BD0F';
+23 -7
View File
@@ -238,18 +238,18 @@ class reportModel extends model
/**
* Get workload.
*
* @param int $dept
* @param int $assign
* @param int $dept
* @param string $assign
*
* @access public
* @return array
*/
public function getWorkload($dept = 0, $assign = 1)
public function getWorkload($dept = 0, $assign = 'assign')
{
$depts = array();
if($dept) $depts = $this->loadModel('dept')->getAllChildId($dept);
if($assign == 0)
if($assign == 'noassign')
{
$project = $this->dao->select('id')->from(TABLE_PROJECT)
->where('deleted')->eq(0)
@@ -291,7 +291,22 @@ class reportModel extends model
->andWhere('t2.deleted')->eq(0)
->andWhere('t2.status')->notin('cancel, closed, done, suspended')
->beginIF($dept)->andWhere('t3.dept')->in($depts)->fi()
->fetchGroup('assignedTo');
->fetchGroup('assignedTo', 'id');
if(empty($tasks)) return array();
$parents = array();
foreach($tasks as $user => $userTasks)
{
if($user)
{
foreach($userTasks as $task)
{
if(!empty($task->parent)) $parents[$task->parent] = $task->parent;
}
}
}
$workload = array();
foreach($tasks as $user => $userTasks)
{
@@ -299,11 +314,12 @@ class reportModel extends model
{
foreach($userTasks as $task)
{
if(!empty($parents) && in_array($task->id, $parents)) continue;
$workload[$user]['task'][$task->projectName]['count'] = isset($workload[$user]['task'][$task->projectName]['count']) ? $workload[$user]['task'][$task->projectName]['count'] + 1 : 1;
$workload[$user]['task'][$task->projectName]['manhour'] = isset($workload[$user]['task'][$task->projectName]['manhour']) ? $workload[$user]['task'][$task->projectName]['manhour'] + $task->left : $task->left;
$workload[$user]['task'][$task->projectName]['projectID'] = $task->project;
$workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1;
if($task->parent == 0) $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left;
$workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1;
$workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left;
}
}
}
+1 -1
View File
@@ -44,7 +44,7 @@
</div>
</div>
<div class='col-sm-1'>
<?php echo html::select('assign', $lang->report->isAssign, $assign, "class='form-control' onchange='changeParams(this)' style='width:90px'");?>
<?php echo html::select('assign', $lang->report->assign, $assign, "class='form-control' onchange='changeParams(this)' style='width:90px'");?>
</div>
<div class='col-sm-1'>
<div class='input-group'><?php echo html::submitButton($lang->report->query);?></div>
+3 -2
View File
@@ -16,8 +16,9 @@
<td>
<table cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5; <?php if(!empty($story->color)) echo 'color: ' . $story->color;?>'>
<?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('story', 'view', "storyID=$story->id"), $mailTitle, '', "style='color: #333; text-decoration: underline;'");?>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'>
<?php $color = empty($story->color) ? '#333' : $story->color;?>
<?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('story', 'view', "storyID=$story->id"), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
</td>
</tr>
</table>
+3 -2
View File
@@ -16,8 +16,9 @@
<td>
<table cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5; <?php if(!empty($task->color)) echo 'color: ' . $task->color;?>'>
<?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('task', 'view', "taskID=$task->id"), $mailTitle, '', "style='color: #333; text-decoration: underline;'");?>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'>
<?php $color = empty($task->color) ? '#333' : $task->color;?>
<?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('task', 'view', "taskID=$task->id"), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
</td>
</tr>
</table>
+1
View File
@@ -405,6 +405,7 @@ class testtask extends control
$this->view->groupBy = $groupBy;
$this->view->groupByList = $groupByList;
$this->view->cases = $groupCases;
$this->view->account = 'all';
$this->display();
}
+2 -1
View File
@@ -17,7 +17,8 @@
<table cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'>
<?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('testtask', 'view', "testtaskID=$testtask->id"), $mailTitle, '', "style='color: #333; text-decoration: underline;'");?>
<?php $color = empty($testtask->color) ? '#333' : $testtask->color;?>
<?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('testtask', 'view', "testtaskID=$testtask->id"), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
</td>
</tr>
</table>
+1 -1
View File
@@ -552,7 +552,7 @@ class todoModel extends model
->get();
$this->dao->update(TABLE_TODO)->data($todo)->where('id')->eq((int)$todoID)->exec();
$this->loadModel('action')->create('todo', $todoID, 'assigned', '', 'assigned');
$this->loadModel('action')->create('todo', $todoID, 'assigned', '', $todo->assignedTo);
return !dao::isError();
}
}