diff --git a/.gitignore b/.gitignore index b90aa51640..3ef6b26261 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +config/db.php config/my.php www/data/ www/install.php diff --git a/module/common/view/header.lite.html.php b/module/common/view/header.lite.html.php index f7773c6115..d78a690368 100755 --- a/module/common/view/header.lite.html.php +++ b/module/common/view/header.lite.html.php @@ -12,7 +12,7 @@ $clientTheme = $this->app->getClientTheme(); - + zentaoPMS); diff --git a/module/report/control.php b/module/report/control.php index 6b08d41115..eeabacfdcb 100644 --- a/module/report/control.php +++ b/module/report/control.php @@ -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); diff --git a/module/report/js/workload.js b/module/report/js/workload.js index 2a2d960b64..2fda97f533 100644 --- a/module/report/js/workload.js +++ b/module/report/js/workload.js @@ -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); -}) +}); diff --git a/module/report/lang/en.php b/module/report/lang/en.php index 41855b2346..355388f501 100644 --- a/module/report/lang/en.php +++ b/module/report/lang/en.php @@ -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'; diff --git a/module/report/lang/zh-cn.php b/module/report/lang/zh-cn.php index 0965b08343..91b5ad9bc2 100644 --- a/module/report/lang/zh-cn.php +++ b/module/report/lang/zh-cn.php @@ -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 . '偏差报表'; diff --git a/module/report/model.php b/module/report/model.php index 60be384fea..f043ae8c2e 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -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; } } diff --git a/module/report/view/workload.html.php b/module/report/view/workload.html.php index 87e8a599d8..96f711b686 100644 --- a/module/report/view/workload.html.php +++ b/module/report/view/workload.html.php @@ -17,7 +17,7 @@
-
+
report->dept;?> @@ -43,6 +43,9 @@
+
+ report->isAssign, $assign, "class='form-control' onchange='changeParams(this)'");?> +
report->query);?>
diff --git a/module/upgrade/model.php b/module/upgrade/model.php index e5e0fb7f5d..28bb16b4e2 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -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; } }