Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
config/db.php
|
||||
config/my.php
|
||||
www/data/
|
||||
www/install.php
|
||||
|
||||
@@ -12,7 +12,7 @@ $clientTheme = $this->app->getClientTheme();
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="renderer" content="webkit">
|
||||
<?php
|
||||
echo html::title($title . ' - ' . $lang->zentaoPMS);
|
||||
|
||||
|
||||
+36
-26
@@ -13,13 +13,13 @@ class report extends control
|
||||
{
|
||||
/**
|
||||
* The index of report, goto project deviation.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->locate(inlink('productSummary'));
|
||||
$this->locate(inlink('productSummary'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ class report extends control
|
||||
|
||||
/**
|
||||
* Product information report.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -65,9 +65,9 @@ class report extends control
|
||||
|
||||
/**
|
||||
* Bug create report.
|
||||
*
|
||||
* @param int $begin
|
||||
* @param int $end
|
||||
*
|
||||
* @param int $begin
|
||||
* @param int $end
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -88,12 +88,12 @@ class report extends control
|
||||
$this->view->project = $project;
|
||||
$this->view->product = $product;
|
||||
$this->view->submenu = 'test';
|
||||
$this->display();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Bug assign report.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -104,34 +104,43 @@ class report extends control
|
||||
$this->view->submenu = 'test';
|
||||
$this->view->assigns = $this->report->getBugAssign();
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted');
|
||||
$this->display();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Workload report.
|
||||
*
|
||||
*
|
||||
* @param string $begin
|
||||
* @param string $end
|
||||
* @param int $days
|
||||
* @param int $workday
|
||||
* @param int $dept
|
||||
* @param int $assign
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function workload($begin = '', $end = '', $days = 0, $workday = 0, $dept = 0)
|
||||
public function workload($begin = '', $end = '', $days = 0, $workday = 0, $dept = 0, $assign = 1)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
$begin = $data->begin;
|
||||
$end = $data->end;
|
||||
$dept = $data->dept;
|
||||
$days = $data->days;
|
||||
$workday = $data->workday;
|
||||
$data = fixer::input('post')->get();
|
||||
$begin = $data->begin;
|
||||
$end = $data->end;
|
||||
$dept = $data->dept;
|
||||
$days = $data->days;
|
||||
$assign = $data->assign;
|
||||
$workday = $data->workday;
|
||||
}
|
||||
|
||||
$this->app->loadConfig('project');
|
||||
$begin = $begin ? strtotime($begin) : time();
|
||||
$end = $end ? strtotime($end) : time() + (7 * 24 * 3600);
|
||||
$end += 24 * 3600;
|
||||
$begin = $begin ? strtotime($begin) : time();
|
||||
$end = $end ? strtotime($end) : time() + (7 * 24 * 3600);
|
||||
$end += 24 * 3600;
|
||||
$beginWeekDay = date('w', $begin);
|
||||
$begin = date('Y-m-d', $begin);
|
||||
$end = date('Y-m-d', $end);
|
||||
$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);
|
||||
@@ -150,7 +159,7 @@ class report extends control
|
||||
$this->view->title = $this->lang->report->workload;
|
||||
$this->view->position[] = $this->lang->report->workload;
|
||||
|
||||
$this->view->workload = $this->report->getWorkload($dept);
|
||||
$this->view->workload = $this->report->getWorkload($dept, $assign);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted');
|
||||
$this->view->depts = $this->loadModel('dept')->getOptionMenu();
|
||||
$this->view->begin = $begin;
|
||||
@@ -158,6 +167,7 @@ class report extends control
|
||||
$this->view->days = $days;
|
||||
$this->view->workday = $workday;
|
||||
$this->view->dept = $dept;
|
||||
$this->view->assign = $assign;
|
||||
$this->view->allHour = $days * $workday;
|
||||
$this->view->submenu = 'staff';
|
||||
$this->display();
|
||||
@@ -165,7 +175,7 @@ class report extends control
|
||||
|
||||
/**
|
||||
* Send daily reminder mail.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -176,7 +186,7 @@ class report extends control
|
||||
if($this->config->report->dailyreminder->task) $tasks = $this->report->getUserTasks();
|
||||
if($this->config->report->dailyreminder->todo) $todos = $this->report->getUserTodos();
|
||||
if($this->config->report->dailyreminder->testTask) $testTasks = $this->report->getUserTestTasks();
|
||||
|
||||
|
||||
$reminder = array();
|
||||
|
||||
$users = array_unique(array_merge(array_keys($bugs), array_keys($tasks), array_keys($todos), array_keys($testTasks)));
|
||||
@@ -216,7 +226,7 @@ class report extends control
|
||||
if($oldViewType == 'json') $this->viewType = 'html';
|
||||
$mailContent = $this->parse('report', 'dailyreminder');
|
||||
$this->viewType == $oldViewType;
|
||||
|
||||
|
||||
/* Send email.*/
|
||||
echo date('Y-m-d H:i:s') . " sending to $user, ";
|
||||
$this->mail->send($user, $mailTitle, $mailContent, '', true);
|
||||
|
||||
@@ -9,6 +9,7 @@ function changeParams(obj)
|
||||
var end = $('.main .row').find('#end').val();
|
||||
var workday = $('.main .row').find('#workday').val();
|
||||
var dept = $('.main .row').find('#dept').val();
|
||||
var assign = $('.main .row').find('#assign').val();
|
||||
var days = diffDate(begin, end);
|
||||
|
||||
$('#days').val(days);
|
||||
@@ -17,23 +18,23 @@ 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)
|
||||
{
|
||||
var endarray = end.split("-");
|
||||
var end = '';
|
||||
for(i=0 ; i < endarray.length ; i++) end = end + endarray[i];
|
||||
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);
|
||||
link = createLink('report', 'workload', 'begin=' + begin + '&end=' + end + '&days=' + days + '&workday=' + workday + '&dept=' + dept + '&assign=' + assign);
|
||||
location.href=link;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a date string to date object in js.
|
||||
*
|
||||
* @param string $date
|
||||
*
|
||||
* @param string $date
|
||||
* @access public
|
||||
* @return date
|
||||
*/
|
||||
@@ -45,9 +46,9 @@ function convertStringToDate(dateString)
|
||||
|
||||
/**
|
||||
* Compute the diff days of two date.
|
||||
*
|
||||
* @param string $date1
|
||||
* @param string $date1
|
||||
*
|
||||
* @param string $date1
|
||||
* @param string $date1
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
@@ -65,12 +66,12 @@ function diffDate(date1, date2)
|
||||
date1 += 1000 * 60 * 60 * 24;
|
||||
date1 = new Date(date1);
|
||||
}
|
||||
return delta - weekEnds;
|
||||
return delta - weekEnds;
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
var options =
|
||||
var options =
|
||||
{
|
||||
language: config.clientLang,
|
||||
weekStart: 1,
|
||||
@@ -85,4 +86,4 @@ $(function()
|
||||
startDate: new Date()
|
||||
};
|
||||
$('input#begin,input#end').fixedDate().datetimepicker(options);
|
||||
})
|
||||
});
|
||||
|
||||
@@ -31,6 +31,9 @@ $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->singleColor[] = 'F6BD0F';
|
||||
|
||||
$lang->report->projectDeviation = $lang->projectCommon . ' Deviation';
|
||||
|
||||
@@ -31,6 +31,9 @@ $lang->report->colors[] = '008ED6';
|
||||
$lang->report->colors[] = '9D080D';
|
||||
$lang->report->colors[] = 'A186BE';
|
||||
|
||||
$lang->report->isAssign[0] = '未指派';
|
||||
$lang->report->isAssign[1] = '已指派';
|
||||
|
||||
$lang->report->singleColor[] = 'F6BD0F';
|
||||
|
||||
$lang->report->projectDeviation = $lang->projectCommon . '偏差报表';
|
||||
|
||||
@@ -238,10 +238,13 @@ class reportModel extends model
|
||||
/**
|
||||
* Get workload.
|
||||
*
|
||||
* @param int $dept
|
||||
* @param int $assign
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getWorkload($dept = 0)
|
||||
public function getWorkload($dept = 0, $assign = 1)
|
||||
{
|
||||
$depts = array();
|
||||
if($dept) $depts = $this->loadModel('dept')->getAllChildId($dept);
|
||||
@@ -265,7 +268,7 @@ class reportModel extends model
|
||||
$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;
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class='main'>
|
||||
<form method='post'>
|
||||
<div class='row' style='margin-bottom:5px;'>
|
||||
<div class='col-sm-3'>
|
||||
<div class='col-sm-2'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->report->dept;?></span>
|
||||
<?php echo html::select('dept', $depts, $dept, "class='form-control chosen' onchange='changeParams(this)'");?>
|
||||
@@ -43,6 +43,9 @@
|
||||
<?php echo html::input('workday', $workday, "class='form-control' autocomplete='off' style='width:50px'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-sm-1'>
|
||||
<?php echo html::select('assign', $lang->report->isAssign, $assign, "class='form-control' onchange='changeParams(this)'");?>
|
||||
</div>
|
||||
<div class='col-sm-1'>
|
||||
<div class='input-group'><?php echo html::submitButton($lang->report->query);?></div>
|
||||
</div>
|
||||
|
||||
@@ -1979,11 +1979,11 @@ class upgradeModel extends model
|
||||
*/
|
||||
public function changeTeamFields()
|
||||
{
|
||||
$this->dao->exec("ALTER TABLE " . TABLE_TEAM . " DROP PRIMARY KEY");
|
||||
$this->dao->exec("ALTER TABLE " . TABLE_TEAM . " CHANGE `project` `root` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");
|
||||
$this->dao->exec("ALTER TABLE " . TABLE_TEAM . " ADD `type` ENUM('project', 'task') NOT NULL DEFAULT 'project' AFTER `root`");
|
||||
$this->dao->exec("UPDATE " . TABLE_TEAM . " SET `root` = `task`, `type` = 'task' WHERE `task` > '0'");
|
||||
$this->dao->exec("ALTER TABLE " . TABLE_TEAM . " DROP `task`");
|
||||
$this->dao->exec("ALTER TABLE `" . TABLE_TEAM . "` DROP PRIMARY KEY");
|
||||
$this->dao->exec("ALTER TABLE `" . TABLE_TEAM . "` CHANGE `project` `root` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");
|
||||
$this->dao->exec("ALTER TABLE `" . TABLE_TEAM . "` ADD `type` ENUM('project', 'task') NOT NULL DEFAULT 'project' AFTER `root`");
|
||||
$this->dao->exec("UPDATE `" . TABLE_TEAM . "` SET `root` = `task`, `type` = 'task' WHERE `task` > '0'");
|
||||
$this->dao->exec("ALTER TABLE `" . TABLE_TEAM . "` DROP `task`");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user