From 86929e218d79cbd5f7a8463dad8786c12155ca88 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 18 Oct 2022 09:21:07 +0800 Subject: [PATCH 01/48] * Finish task #72348. --- module/task/lang/de.php | 1 + module/task/lang/en.php | 1 + module/task/lang/fr.php | 1 + module/task/lang/zh-cn.php | 1 + module/task/view/activate.html.php | 4 ++-- 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/module/task/lang/de.php b/module/task/lang/de.php index f0a1f3ad84..584e16ea3b 100644 --- a/module/task/lang/de.php +++ b/module/task/lang/de.php @@ -277,6 +277,7 @@ $lang->task->error->alreadyConsumed = 'The currently selected parent task has $lang->task->error->date = 'The date should be <= today.'; $lang->task->error->leftEmptyAB = 'When the task status is %s, "Hours Left" cannot be 0'; $lang->task->error->leftEmpty = 'Task#%sWhen the task status is %s, "Left" cannot be 0'; +$lang->task->error->notempty = '%s must be > 0.'; /* Report. */ $lang->task->report = new stdclass(); diff --git a/module/task/lang/en.php b/module/task/lang/en.php index ec3982d903..dff129d70c 100755 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -277,6 +277,7 @@ $lang->task->error->alreadyConsumed = 'The currently selected parent task has $lang->task->error->date = 'The date should be <= today.'; $lang->task->error->leftEmptyAB = 'When the task status is %s, "Hours Left" cannot be 0'; $lang->task->error->leftEmpty = 'Task#%sWhen the task status is %s, "Left" cannot be 0'; +$lang->task->error->notempty = '%s must be > 0.'; /* Report. */ $lang->task->report = new stdclass(); diff --git a/module/task/lang/fr.php b/module/task/lang/fr.php index 0b2b1eb1e2..ed2b0c8d9a 100644 --- a/module/task/lang/fr.php +++ b/module/task/lang/fr.php @@ -277,6 +277,7 @@ $lang->task->error->alreadyConsumed = 'The currently selected parent task has $lang->task->error->date = 'The date should be <= today.'; $lang->task->error->leftEmptyAB = 'When the task status is %s, "Hours Left" cannot be 0'; $lang->task->error->leftEmpty = 'Task#%sWhen the task status is %s, "Left" cannot be 0'; +$lang->task->error->notempty = '%s must be > 0.'; /* Report. */ $lang->task->report = new stdclass(); diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index 506c414896..41c8f326cc 100755 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -277,6 +277,7 @@ $lang->task->error->alreadyConsumed = '当前选中的父任务已有消耗。 $lang->task->error->date = '日期不能大于今天'; $lang->task->error->leftEmptyAB = '任务状态为%s时,预计剩余不能为0'; $lang->task->error->leftEmpty = 'Task#%s任务状态为%s时,剩余不能为0'; +$lang->task->error->notempty = '%s必须大于0。'; /* Report. */ $lang->task->report = new stdclass(); diff --git a/module/task/view/activate.html.php b/module/task/view/activate.html.php index 302e5e1c66..1e76423712 100644 --- a/module/task/view/activate.html.php +++ b/module/task/view/activate.html.php @@ -18,8 +18,8 @@ task->error->teamMember);?> lang->task->error->leftEmptyAB, $this->lang->task->statusList[$task->status]));?> -error->notempty, $lang->task->estimate))?> -error->notempty, $lang->task->left))?> +task->error->notempty, $lang->task->estimate))?> +task->error->notempty, $lang->task->left))?>
From 8c85776666951570797952b0f4aa68c9da0caa86 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 18 Oct 2022 09:28:51 +0800 Subject: [PATCH 02/48] * Finish task #72348. --- module/task/js/activate.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/task/js/activate.js b/module/task/js/activate.js index 654188a1d5..9987ff3b5a 100644 --- a/module/task/js/activate.js +++ b/module/task/js/activate.js @@ -18,9 +18,9 @@ $('#confirmButton').click(function() if(!isNaN(estimate)) totalEstimate += estimate; if($tr.hasClass('member-wait') && (isNaN(estimate) || estimate == 0)) { - bootbox.alert(account + ' ' + estimateNotEmpty); - error = true; - return false; + bootbox.alert(account + ' ' + estimateNotEmpty); + error = true; + return false; } var consumed = parseFloat($tr.find('[name^=teamConsumed]').val()); From 8bbf77788a4d151108ac82b5f8dab7e784853ee3 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 18 Oct 2022 14:34:29 +0800 Subject: [PATCH 03/48] * Finish task #72348. --- module/task/js/activate.js | 4 ++-- module/task/model.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/module/task/js/activate.js b/module/task/js/activate.js index 9987ff3b5a..6f3b085f86 100644 --- a/module/task/js/activate.js +++ b/module/task/js/activate.js @@ -16,7 +16,7 @@ $('#confirmButton').click(function() var estimate = parseFloat($tr.find('[name^=teamEstimate]').val()); if(!isNaN(estimate)) totalEstimate += estimate; - if($tr.hasClass('member-wait') && (isNaN(estimate) || estimate == 0)) + if($tr.hasClass('member-wait') && (isNaN(estimate) || estimate <= 0)) { bootbox.alert(account + ' ' + estimateNotEmpty); error = true; @@ -29,7 +29,7 @@ $('#confirmButton').click(function() var $left = $tr.find('[name^=teamLeft]'); var left = parseFloat($left.val()); if(!isNaN(left)) totalLeft += left; - if(!$left.prop('readonly') && $tr.hasClass('member-wait') && (isNaN(left) || left == 0)) + if(!$left.prop('readonly') && $tr.hasClass('member-wait') && (isNaN(left) || left <= 0)) { bootbox.alert(account + ' ' + leftNotEmpty); error = true; diff --git a/module/task/model.php b/module/task/model.php index 34aaffe3ce..42f3304c0e 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -2283,6 +2283,12 @@ class taskModel extends model return false; } + if(empty($task->left)) + { + dao::$errors[] = sprintf($this->lang->task->error->notempty, $this->lang->task->left); + return false; + } + if(!empty($oldTask->team)) { $this->manageTaskTeam($oldTask->mode, $oldTask->id, $task->status); From 11a5a5fbf372444d3031f722365a0be24b36c7de Mon Sep 17 00:00:00 2001 From: wangzemei Date: Tue, 18 Oct 2022 16:32:06 +0800 Subject: [PATCH 04/48] * task 72350 --- module/report/css/annualdata.css | 70 +++++++++ module/report/js/annualdata.js | 2 + module/report/js/processor.js | 46 ++++++ module/report/view/annualdata.html.php | 192 ++++++++++++++++++++++++- 4 files changed, 308 insertions(+), 2 deletions(-) create mode 100644 module/report/js/processor.js diff --git a/module/report/css/annualdata.css b/module/report/css/annualdata.css index eca95154a2..f97e6720f1 100644 --- a/module/report/css/annualdata.css +++ b/module/report/css/annualdata.css @@ -82,3 +82,73 @@ section.active {border: 1px solid rgb(0, 166, 255);} .dataYearStat .canvas {float: left; height: 305px; padding-left: 30px;} .dataYearStat .canvas.left {width: 450px;} .dataYearStat .canvas.right {width: 810px; float: right;} + +#timeline { + display: inline-block; + width: 310px; + padding-top: 20px; + list-style: none; + text-align: center; + margin-left: 25px; + } + .scroll-shell { + position: relative; + } + #stopPlaying { + font-size: 18px; + position: absolute; + left: 0; + top: 8px; + } + + #timeline li { + display: inline-block; + cursor: pointer; + color: #444; + padding: 0 5px; + margin: 0; + position: relative; + } + + + #timeline li::before{ + content: ''; + display: inline-block; + width: 8px; + height: 8px; + border-radius: 4px; + background: #fff; + position: absolute; + left: 20px; + top: -8px; + z-index: 2; + } + #timeline li::after{content: ''; display: block; width: 100%; height: 2px; border-radius: 1px; background: #fff; position: absolute; left: -20px; top: -5px;} + + .biaoqian { + background-size: 60px 24px; + } + + #timeline .selecteded { + color: #1a77a5; + /* background: url('img/tuoyuan2.png') 0 15px no-repeat; + background-size: 20px 20px; */ + } + #timeline .selecteded::before { + background: #1a77a5; + } + + .scroll-shell { + width: 100px; + height: 96%; + margin-top: 1.5%; + float: left; + overflow: hidden; + } +.scroll-shell {width: 330px;} +.scroll { + width: 330px; + height: 103%; + overflow: auto; + overflow-x: hidden; +} \ No newline at end of file diff --git a/module/report/js/annualdata.js b/module/report/js/annualdata.js index 67fa201cc7..31d654ce20 100644 --- a/module/report/js/annualdata.js +++ b/module/report/js/annualdata.js @@ -52,6 +52,7 @@ function drawStatusPieChart(id, title, data, callback) itemHeight: legendItemHeight, textStyle: legendTextStyle, }, + saveAsImage: {}, series: [ { name: title, @@ -186,6 +187,7 @@ function exportAnnualImage(sucessCallback, errorCallback) if(sucessCallback) sucessCallback(imageUrl); afterFinish(canvas); }); + console.log(imageUrl); }); } diff --git a/module/report/js/processor.js b/module/report/js/processor.js new file mode 100644 index 0000000000..dd8093fed1 --- /dev/null +++ b/module/report/js/processor.js @@ -0,0 +1,46 @@ +let processor = { + timerCallback: function() { + if (this.video.paused || this.video.ended) { + return; + } + this.computeFrame(); + let self = this; + setTimeout(function () { + self.timerCallback(); + }, 0); + }, + + doLoad: function() { + this.video = document.getElementById("video"); + this.c1 = document.getElementById("c1"); + this.ctx1 = this.c1.getContext("2d"); + this.c2 = document.getElementById("c2"); + this.ctx2 = this.c2.getContext("2d"); + let self = this; + this.video.addEventListener("play", function() { + self.width = self.video.videoWidth / 2; + self.height = self.video.videoHeight / 2; + self.timerCallback(); + }, false); + }, + + computeFrame: function() { + this.ctx1.drawImage(this.video, 0, 0, this.width, this.height); + let frame = this.ctx1.getImageData(0, 0, this.width, this.height); + let l = frame.data.length / 4; + + for (let i = 0; i < l; i++) { + let r = frame.data[i * 4 + 0]; + let g = frame.data[i * 4 + 1]; + let b = frame.data[i * 4 + 2]; + if (g > 100 && r > 100 && b < 43) + frame.data[i * 4 + 3] = 0; + } + this.ctx2.putImageData(frame, 0, 0); + return; + } +}; + +document.addEventListener("DOMContentLoaded", () => { +processor.doLoad(); +}); \ No newline at end of file diff --git a/module/report/view/annualdata.html.php b/module/report/view/annualdata.html.php index 4cf774c9c2..bc932a46a6 100644 --- a/module/report/view/annualdata.html.php +++ b/module/report/view/annualdata.html.php @@ -5,6 +5,7 @@ report->annualData;?> report->annualData;?> soFar, $year);?> +
)'>
) top no-repeat'>