From 5b5184b0ca089dd3331b0a89b2649afbe5b8ae9b Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Thu, 27 Aug 2020 13:55:46 +0800 Subject: [PATCH 1/3] * Edit Risk lang file. --- module/risk/lang/en.php | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/module/risk/lang/en.php b/module/risk/lang/en.php index 0234a597bd..6f6b91607a 100644 --- a/module/risk/lang/en.php +++ b/module/risk/lang/en.php @@ -1,9 +1,9 @@ risk->batchCreate = 'Batch Add'; -$lang->risk->create = 'Add Risk'; +$lang->risk->batchCreate = 'Batch Create'; +$lang->risk->create = 'Create Risk'; $lang->risk->edit = 'Edit Risk'; -$lang->risk->browse = 'List'; +$lang->risk->browse = 'Risks'; $lang->risk->view = 'Details'; $lang->risk->activate = 'Active'; $lang->risk->hangup = 'Suspend'; @@ -28,29 +28,29 @@ $lang->risk->riskindex = 'Risk Index'; $lang->risk->pri = 'Priority'; $lang->risk->prevention = 'Mitigation'; $lang->risk->remedy = 'Contingency'; -$lang->risk->identifiedDate = 'Identified Date'; -$lang->risk->plannedClosedDate = 'Closed Date'; +$lang->risk->identifiedDate = 'Identified'; +$lang->risk->plannedClosedDate = 'Deadline'; $lang->risk->assignedTo = 'AssignedTo'; -$lang->risk->assignedDate = 'Assigned Date'; -$lang->risk->createdBy = 'Added By'; -$lang->risk->createdDate = 'Added Date'; +$lang->risk->assignedDate = 'AssignedDate'; +$lang->risk->createdBy = 'CreatedBy'; +$lang->risk->createdDate = 'CreatedDate'; $lang->risk->noAssigned = 'Unassigned'; -$lang->risk->cancelBy = 'Canceled By'; -$lang->risk->cancelDate = 'Canceled Date'; +$lang->risk->cancelBy = 'CanceledBy'; +$lang->risk->cancelDate = 'CanceledDate'; $lang->risk->cancelReason = 'Cancel Reason'; -$lang->risk->resolvedBy = 'Resolved By'; -$lang->risk->closedDate = 'Closed Date'; +$lang->risk->resolvedBy = 'ResolvedBy'; +$lang->risk->closedDate = 'ClosedDate'; $lang->risk->actualClosedDate = 'Closed Date'; $lang->risk->resolution = 'Resolution'; -$lang->risk->hangupBy = 'Suspended By'; -$lang->risk->hangupDate = 'Suspended Date'; -$lang->risk->activateBy = 'Activated By'; -$lang->risk->activateDate = 'Activated Date'; +$lang->risk->hangupBy = 'SuspendedBy'; +$lang->risk->hangupDate = 'SuspendedDate'; +$lang->risk->activateBy = 'ActivatedBy'; +$lang->risk->activateDate = 'ActivatedDate'; $lang->risk->isChange = 'Any change?'; -$lang->risk->trackedBy = 'Tracked By'; -$lang->risk->trackedDate = 'Tracked Date'; -$lang->risk->editedBy = 'Edited By'; -$lang->risk->editedDate = 'Edited By'; +$lang->risk->trackedBy = 'TrackedBy'; +$lang->risk->trackedDate = 'TrackedDate'; +$lang->risk->editedBy = 'EditedBy'; +$lang->risk->editedDate = 'EditedDate'; $lang->risk->legendBasicInfo = 'Basic Info.'; $lang->risk->legendLifeTime = 'About Risk'; From e5d595985e17d684a4df8149f22f71e713d02851 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Thu, 27 Aug 2020 14:03:13 +0800 Subject: [PATCH 2/3] *Add weekly module notes. --- module/weekly/control.php | 29 ++++++- module/weekly/lang/en.php | 10 +++ module/weekly/lang/zh-cn.php | 10 +++ module/weekly/model.php | 163 ++++++++++++++++++++++++++++++++++- 4 files changed, 205 insertions(+), 7 deletions(-) diff --git a/module/weekly/control.php b/module/weekly/control.php index 9f3400c7e3..6ba7e6029d 100644 --- a/module/weekly/control.php +++ b/module/weekly/control.php @@ -11,12 +11,27 @@ */ class weekly extends control { + /** + * The construct function, load users. + * + * @access public + * @return void + */ + public function __construct() { parent::__construct(); $this->view->users = $this->loadModel('user')->getPairs('noletter'); } + /** + * Index + * + * @param int $program + * @param string $date + * @access public + * @return void + */ public function index($program = 0, $date = '') { $program = $program ? $program : $this->session->program; @@ -46,13 +61,19 @@ class weekly extends control $this->display(); } + /** + * ComputeWeekly + * + * @access public + * @return void + */ public function computeWeekly() { $programs = $this->dao->select('id, name')->from(TABLE_PROJECT) - ->where('deleted')->eq(0) - ->andWhere('isCat')->eq(0) - ->andWhere('template')->ne('') - ->andWhere('program')->eq(0) + ->where('deleted')->eq(0) + ->andWhere('isCat')->eq(0) + ->andWhere('template')->ne('') + ->andWhere('program')->eq(0) ->fetchPairs(); $date = helper::today(); diff --git a/module/weekly/lang/en.php b/module/weekly/lang/en.php index 752f1cefb9..cc7df27db0 100644 --- a/module/weekly/lang/en.php +++ b/module/weekly/lang/en.php @@ -1,4 +1,14 @@ + * @package weekly + * @version $Id: en.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ $lang->weekly->common = 'Project Weekly'; $lang->weekly->index = 'Weekly newspaper overview'; $lang->weekly->progress = 'Percent Completed'; diff --git a/module/weekly/lang/zh-cn.php b/module/weekly/lang/zh-cn.php index b21a2a2fd0..965e788d12 100644 --- a/module/weekly/lang/zh-cn.php +++ b/module/weekly/lang/zh-cn.php @@ -1,4 +1,14 @@ + * @package weekly + * @version $Id: zh-cn.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ $lang->weekly->common = '项目周报'; $lang->weekly->index = '周报总览'; $lang->weekly->progress = '完成百分比'; diff --git a/module/weekly/model.php b/module/weekly/model.php index 9ca9330d2d..c7b0758908 100644 --- a/module/weekly/model.php +++ b/module/weekly/model.php @@ -11,6 +11,14 @@ */ class weeklyModel extends model { + /** + * GetPageNav + * + * @param int $program + * @param int $date + * @access public + * @return string + */ public function getPageNav($program, $date) { $date = date('Ymd', strtotime($this->getThisMonday($date))); @@ -34,6 +42,13 @@ class weeklyModel extends model } + /** + * GetWeekPairs + * + * @param int $begin + * @access public + * @return array + */ public function getWeekPairs($begin) { $sn = $this->getWeekSN($begin, date('Y-m-d')); @@ -50,6 +65,14 @@ class weeklyModel extends model return $weeks; } + /** + * GetFromDB + * + * @param int $program + * @param int $date + * @access public + * @return object + */ public function getFromDB($program, $date) { $monday = $this->getThisMonday($date); @@ -60,6 +83,14 @@ class weeklyModel extends model ->fetch(); } + /** + * Save + * + * @param int $program + * @param int $date + * @access public + * @return void + */ public function save($program, $date) { $report = new stdclass; @@ -75,11 +106,26 @@ class weeklyModel extends model $this->dao->replace(TABLE_WEEKLYREPORT)->data($report)->exec(); } + /** + * GetWeekSN + * + * @param int $begin + * @param int $date + * @access public + * @return int + */ public function getWeekSN($begin, $date) { return ceil((strtotime($date) - strtotime($begin)) / 7 / 86400); } + /** + * GetThisMonday + * + * @param int $date + * @access public + * @return date + */ public function getThisMonday($date) { $day = date('w', strtotime($date)); @@ -88,12 +134,26 @@ class weeklyModel extends model return date('Y-m-d', strtotime("$date - $days days")); } + /** + * GetThisSunday + * + * @param int $date + * @access public + * @return date + */ public function getThisSunday($date) { $monday = $this->getThisMonday($date); return date('Y-m-d', strtotime("$monday +6 days")); } + /** + * GetLastDay + * + * @param int $date + * @access public + * @return string + */ public function getLastDay($date) { $this->loadModel('project'); @@ -104,6 +164,14 @@ class weeklyModel extends model return end($workdays); } + /** + * GetStaff + * + * @param int $program + * @param string $date + * @access public + * @return array + */ public function getStaff($program, $date = '') { if(!$date) $date = date('Y-m-d'); @@ -121,6 +189,15 @@ class weeklyModel extends model ->fetch('count'); } + /** + * GetFinished + * + * @param int $program + * @param string $date + * @param int $pager + * @access public + * @return void + */ public function getFinished($program, $date = '', $pager = null) { if(!$date) $date = date('Y-m-d'); @@ -140,6 +217,14 @@ class weeklyModel extends model return $this->loadModel('task')->processTasks($tasks); } + /** + * GetPostponed + * + * @param int $program + * @param string $date + * @access public + * @return void + */ public function getPostponed($program, $date = '') { if(!$date) $date = date('Y-m-d'); @@ -169,6 +254,14 @@ class weeklyModel extends model return $this->loadModel('task')->processTasks($tasks); } + /** + * GetTasksOfNextWeek + * + * @param int $program + * @param string $date + * @access public + * @return void + */ public function getTasksOfNextWeek($program, $date = '') { if(!$date) $date = date('Y-m-d'); @@ -188,6 +281,14 @@ class weeklyModel extends model return $this->loadModel('task')->processTasks($tasks); } + /** + * GetWorkloadByType + * + * @param int $program + * @param string $date + * @access public + * @return object + */ public function getWorkloadByType($program, $date = '') { if(!$date) $date = date('Y-m-d'); @@ -206,6 +307,14 @@ class weeklyModel extends model ->fetchPairs(); } + /** + * GetPlanedTaskByWeek + * + * @param int $program + * @param string $date + * @access public + * @return array + */ public function getPlanedTaskByWeek($program, $date = '') { if(!$date) $date = date('Y-m-d'); @@ -222,6 +331,14 @@ class weeklyModel extends model ->fetchAll('id'); } + /** + * GetPV + * + * @param int $program + * @param string $date + * @access public + * @return int + */ public function getPV($program, $date = '') { $report = $this->getFromDB($program, $date); @@ -235,7 +352,7 @@ class weeklyModel extends model $lastDay = $this->getLastDay($date); $nextMonday = date('Y-m-d', strtotime("$sunday +1 days")); $workdays = $this->loadModel('holiday')->getActualWorkingDays($monday, $sunday); - + $projects = $this->loadModel('project')->getList($status = 'all', $limit = 0, $productID = 0, $branch = 0, $program->id); $projectIdList = array_keys($projects); @@ -263,11 +380,19 @@ class weeklyModel extends model return round($PV, 2); } + /** + * GetEV + * + * @param int $program + * @param string $date + * @access public + * @return int + */ public function getEV($program, $date = '') { $report = $this->getFromDB($program, $date); if(!empty($report)) return $report->ev; - + $projects = $this->loadModel('project')->getList($status = 'all', $limit = 0, $productID = 0, $branch = 0, $program); $projectIdList = array_keys($projects); @@ -300,11 +425,19 @@ class weeklyModel extends model return round($EV, 2); } + /** + * GetAC + * + * @param int $program + * @param string $date + * @access public + * @return int + */ public function getAC($program, $date = '') { $report = $this->getFromDB($program, $date); if(!empty($report)) return $report->ac; - + if(!$date) $date = date('Y-m-d'); $monday = $this->getThisMonday($date); @@ -323,6 +456,14 @@ class weeklyModel extends model return round($AC, 2); } + /** + * GetSV + * + * @param int $ev + * @param int $pv + * @access public + * @return int + */ public function getSV($ev, $pv) { if($pv == 0) return 0; @@ -330,6 +471,14 @@ class weeklyModel extends model return number_format($sv * 100, 2); } + /** + * GetCV + * + * @param int $ev + * @param int $ac + * @access public + * @return int + */ public function getCV($ev, $ac) { if($ac == 0) return 0; @@ -337,6 +486,14 @@ class weeklyModel extends model return number_format($cv * 100, 2); } + /** + * GetTips + * + * @param string $type + * @param int $data + * @access public + * @return string + */ public function getTips($type = 'progress', $data = 0) { $this->app->loadConfig('custom'); From d20ca16a93489dd851ccf185df0f3ac4421eb3a7 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 27 Aug 2020 14:03:29 +0800 Subject: [PATCH 3/3] * Add subject comment. --- module/subject/control.php | 17 +++++++++++++++++ module/subject/lang/en.php | 10 ++++++++++ module/subject/lang/zh-cn.php | 10 ++++++++++ module/subject/view/browse.html.php | 4 ++-- 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/module/subject/control.php b/module/subject/control.php index ce5273b3d8..c4cb9b61cc 100644 --- a/module/subject/control.php +++ b/module/subject/control.php @@ -1,6 +1,23 @@ + * @package subject + * @version $Id: control.php 5107 2013-07-12 01:46:12Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ class subject extends control { + /** + * Browse subjects + * + * @param int $currentModuleID + * @access public + * @return void + */ public function browse($currentModuleID = 0) { $this->view->title = $this->lang->subject->manage; diff --git a/module/subject/lang/en.php b/module/subject/lang/en.php index 17a546f008..9a5b9183d2 100644 --- a/module/subject/lang/en.php +++ b/module/subject/lang/en.php @@ -1,4 +1,14 @@ + * @package subject + * @version $Id: en.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ $lang->subject->common = 'Subject'; $lang->subject->manage = 'Manage Subject'; $lang->subject->manageChild = 'Manage Child Subject'; diff --git a/module/subject/lang/zh-cn.php b/module/subject/lang/zh-cn.php index 016d79d9ac..c072fee9b9 100644 --- a/module/subject/lang/zh-cn.php +++ b/module/subject/lang/zh-cn.php @@ -1,4 +1,14 @@ + * @package subject + * @version $Id: zh-cn.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ $lang->subject->common = '科目'; $lang->subject->manage = '科目维护'; $lang->subject->manageChild = '维护子科目'; diff --git a/module/subject/view/browse.html.php b/module/subject/view/browse.html.php index 8a2e8f375e..fc36b516be 100644 --- a/module/subject/view/browse.html.php +++ b/module/subject/view/browse.html.php @@ -1,11 +1,11 @@ - * @package tree + * @package subject * @version $Id: browse.html.php 4796 2013-06-06 02:21:59Z zhujinyonging@gmail.com $ * @link http://www.zentao.net */