From 2cc1105512bfd98d31767dd31c0e5022fc2ec1f1 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Thu, 24 Feb 2022 16:59:39 +0800 Subject: [PATCH] * fix move extensions to module --- extension/lite/task/ext/model/lite.php | 199 ------------------------- module/task/model.php | 4 + 2 files changed, 4 insertions(+), 199 deletions(-) diff --git a/extension/lite/task/ext/model/lite.php b/extension/lite/task/ext/model/lite.php index e6fd63f425..9a4dacf7c3 100644 --- a/extension/lite/task/ext/model/lite.php +++ b/extension/lite/task/ext/model/lite.php @@ -1,5 +1,4 @@ processTasks($tasks); -} - -/** - * Print cell data. - * - * @param object $col - * @param object $task - * @param array $users - * @param string $browseType - * @param array $branchGroups - * @param array $modulePairs - * @param string $mode - * @param bool $child - * @param bool $showBranch - * - * @access public - * @return void - */ -public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array(), $mode = 'datatable', $child = false, $showBranch = false) -{ - $canBatchEdit = common::hasPriv('task', 'batchEdit', !empty($task) ? $task : null); - $canBatchClose = (common::hasPriv('task', 'batchClose', !empty($task) ? $task : null) and strtolower($browseType) != 'closed'); - $canBatchCancel = common::hasPriv('task', 'batchCancel', !empty($task) ? $task : null); - $canBatchChangeModule = common::hasPriv('task', 'batchChangeModule', !empty($task) ? $task : null); - $canBatchAssignTo = common::hasPriv('task', 'batchAssignTo', !empty($task) ? $task : null); - - $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchCancel or $canBatchChangeModule or $canBatchAssignTo); - $storyChanged = (!empty($task->storyStatus) and $task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion and !in_array($task->status, array('cancel', 'closed'))); - - $canView = common::hasPriv('task', 'view'); - $taskLink = helper::createLink('task', 'view', "taskID=$task->id"); - $account = $this->app->user->account; - $id = $col->id; - if($col->show) - { - $class = "c-{$id}"; - if($id == 'status') $class .= ' task-' . $task->status; - if($id == 'id') $class .= ' cell-id'; - if($id == 'name') $class .= ' text-left'; - if($id == 'deadline') $class .= ' text-center'; - if($id == 'deadline' and isset($task->delay)) $class .= ' delayed'; - if($id == 'assignedTo') $class .= ' has-btn text-left'; - if($id == 'lane') $class .= ' text-left'; - if(strpos('progress', $id) !== false) $class .= ' text-right'; - - $title = ''; - if($id == 'name') - { - $title = " title='{$task->name}'"; - if(!empty($task->children)) $class .= ' has-child'; - } - if($id == 'story') $title = " title='{$task->storyTitle}'"; - if($id == 'estimate' || $id == 'consumed' || $id == 'left') - { - $value = round($task->$id, 1); - $title = " title='{$value} {$this->lang->execution->workHour}'"; - } - - echo ""; - if(isset($this->config->bizVersion)) $this->loadModel('flow')->printFlowCell('task', $task, $id); - switch($id) - { - case 'id': - if($canBatchAction) - { - echo html::checkbox('taskIDList', array($task->id => '')) . html::a(helper::createLink('task', 'view', "taskID=$task->id"), sprintf('%03d', $task->id)); - } - else - { - printf('%03d', $task->id); - } - break; - case 'pri': - echo ""; - echo zget($this->lang->task->priList, $task->pri, $task->pri); - echo ""; - break; - case 'name': - if($showBranch) $showBranch = isset($this->config->execution->task->showBranch) ? $this->config->execution->task->showBranch : 1; - if($task->parent > 0 and isset($task->parentName)) $task->name = "{$task->parentName} / {$task->name}"; - if(!empty($task->product) and isset($branchGroups[$task->product][$task->branch]) and $showBranch) echo "" . $branchGroups[$task->product][$task->branch] . ' '; - if($task->module and isset($modulePairs[$task->module])) echo "" . $modulePairs[$task->module] . ' '; - if($task->parent > 0) echo '' . $this->lang->task->childrenAB . ' '; - if(!empty($task->team)) echo '' . $this->lang->task->multipleAB . ' '; - echo $canView ? html::a($taskLink, $task->name, null, "style='color: $task->color' title='$task->name'") : "$task->name"; - if(!empty($task->children)) echo ''; - if($task->fromBug) echo html::a(helper::createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '', "class='bug'"); - break; - case 'type': - echo $this->lang->task->typeList[$task->type]; - break; - case 'status': - $storyChanged ? print("{$this->lang->story->changed}") : print(" " . $this->processStatus('task', $task) . ""); - break; - case 'estimate': - echo round($task->estimate, 1) . $this->lang->execution->workHourUnit; - break; - case 'consumed': - echo round($task->consumed, 1) . $this->lang->execution->workHourUnit; - break; - case 'left': - echo round($task->left, 1) . $this->lang->execution->workHourUnit; - break; - case 'progress': - echo round($task->progress, 2) . '%'; - break; - case 'deadline': - if(substr($task->deadline, 0, 4) > 0) echo substr($task->deadline, 5, 6); - break; - case 'openedBy': - echo zget($users, $task->openedBy); - break; - case 'openedDate': - echo substr($task->openedDate, 5, 11); - break; - case 'estStarted': - echo $task->estStarted; - break; - case 'realStarted': - echo substr($task->realStarted, 5, 11); - break; - case 'assignedTo': - $this->printAssignedHtml($task, $users); - break; - case 'lane': - echo trim($task->lane); - break; - case 'assignedDate': - echo substr($task->assignedDate, 5, 11); - break; - case 'finishedBy': - echo zget($users, $task->finishedBy); - break; - case 'finishedDate': - echo substr($task->finishedDate, 5, 11); - break; - case 'canceledBy': - echo zget($users, $task->canceledBy); - break; - case 'canceledDate': - echo substr($task->canceledDate, 5, 11); - break; - case 'closedBy': - echo zget($users, $task->closedBy); - break; - case 'closedDate': - echo substr($task->closedDate, 5, 11); - break; - case 'closedReason': - echo $this->lang->task->reasonList[$task->closedReason]; - break; - case 'story': - if(!empty($task->storyID)) - { - if(common::hasPriv('story', 'view')) - { - echo html::a(helper::createLink('story', 'view', "storyid=$task->storyID", 'html', true), "", '', "class='iframe' data-width='1050' title='{$task->storyTitle}'"); - } - else - { - echo ""; - } - } - break; - case 'mailto': - $mailto = explode(',', $task->mailto); - foreach($mailto as $account) - { - $account = trim($account); - if(empty($account)) continue; - echo zget($users, $account) . '  '; - } - break; - case 'lastEditedBy': - echo zget($users, $task->lastEditedBy); - break; - case 'lastEditedDate': - echo substr($task->lastEditedDate, 5, 11); - break; - case 'actions': - if($storyChanged) - { - common::printIcon('task', 'confirmStoryChange', "taskid=$task->id", $task, 'list', '', 'hiddenwin'); - break; - } - - if($task->status != 'pause') common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); - if($task->status == 'pause') common::printIcon('task', 'restart', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); - common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); - common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); - - common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'list', 'time', '', 'iframe', true); - common::printIcon('task', 'edit', "taskID=$task->id", $task, 'list'); - common::printIcon('task', 'batchCreate', "execution=$task->execution&storyID=$task->story&moduleID=$task->module&taskID=$task->id&ifame=0", $task, 'list', 'split', '', '', '', '', $this->lang->task->children); - break; - } - echo ''; - } } \ No newline at end of file diff --git a/module/task/model.php b/module/task/model.php index edf8bd0f8d..b4546170e4 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -3101,6 +3101,7 @@ class taskModel extends model if($id == 'deadline') $class .= ' text-center'; if($id == 'deadline' and isset($task->delay)) $class .= ' delayed'; if($id == 'assignedTo') $class .= ' has-btn text-left'; + if($id == 'lane') $class .= ' text-left'; if(strpos('progress', $id) !== false) $class .= ' text-right'; $title = ''; @@ -3182,6 +3183,9 @@ class taskModel extends model case 'assignedTo': $this->printAssignedHtml($task, $users); break; + case 'lane': + echo trim($task->lane); + break; case 'assignedDate': echo substr($task->assignedDate, 5, 11); break;