diff --git a/module/bug/model.php b/module/bug/model.php index 22f85cac73..c0c7c33233 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2581,17 +2581,7 @@ class bugModel extends model } break; case 'assignedTo': - $btnTextClass = ''; - $assignedToText = !empty($bug->assignedTo) ? zget($users, $bug->assignedTo) : $this->lang->bug->noAssigned; - $btnTextClass = 'text-primary'; - if($bug->assignedTo == $account) $btnTextClass = 'text-red'; - - $btnClass = $assignedToText == 'closed' ? ' disabled' : ''; - $btnClass = "iframe btn btn-icon-left btn-sm {$btnClass}"; - $assignToLink = helper::createLink('bug', 'assignTo', "bugID=$bug->id", '', true); - $assignToHtml = html::a($assignToLink, " {$assignedToText}", '', "class='$btnClass'"); - - echo !common::hasPriv('bug', 'assignTo') ? "{$assignedToText}" : $assignToHtml; + $this->printAssignedHtml($bug, $users); break; case 'assignedDate': echo substr($bug->assignedDate, 5, 11); @@ -2636,6 +2626,29 @@ class bugModel extends model } } + /** + * Print assigned html. + * + * @param object $bug + * @param array $users + * @access public + * @return void + */ + public function printAssignedHtml($bug, $users) + { + $btnTextClass = ''; + $assignedToText = !empty($bug->assignedTo) ? zget($users, $bug->assignedTo) : $this->lang->bug->noAssigned; + $btnTextClass = 'text-primary'; + if($bug->assignedTo == $this->app->user->account) $btnTextClass = 'text-red'; + + $btnClass = $assignedToText == 'closed' ? ' disabled' : ''; + $btnClass = "iframe btn btn-icon-left btn-sm {$btnClass}"; + $assignToLink = helper::createLink('bug', 'assignTo', "bugID=$bug->id", '', true); + $assignToHtml = html::a($assignToLink, " {$assignedToText}", '', "class='$btnClass'"); + + echo !common::hasPriv('bug', 'assignTo') ? "{$assignedToText}" : $assignToHtml; + } + /** * Send mail * diff --git a/module/editor/model.php b/module/editor/model.php index 0eaa79f0b7..dc1b2621d1 100644 --- a/module/editor/model.php +++ b/module/editor/model.php @@ -207,12 +207,7 @@ class editorModel extends model $langFile = dirname(key($files)) . DS . 'lang' . DS . $this->cookie->lang. '.php'; if(file_exists($langFile)) { - if(!isset($lang)) - { - $lang = new stdclass(); - $lang->projectCommon = $this->lang->projectCommon; - $lang->productCommon = $this->lang->productCommon; - } + if(!isset($lang)) $lang = $this->lang; if(!isset($lang->$module)) $lang->$module = new stdclass(); include_once $langFile; } diff --git a/module/my/view/bug.html.php b/module/my/view/bug.html.php index baede6784f..6701cf8356 100644 --- a/module/my/view/bug.html.php +++ b/module/my/view/bug.html.php @@ -47,10 +47,10 @@ typeAB);?> bug->title);?> openedByAB);?> - bug->assignedTo);?> + bug->assignedTo);?> bug->resolvedByAB);?> bug->resolutionAB);?> - actions;?> + actions;?> @@ -70,14 +70,12 @@ bug->typeList, $bug->type, '');?> createLink('bug', 'view', "bugID=$bug->id"), $bug->title, null, "style='color: $bug->color'");?> openedBy);?> - " . zget($users, $bug->assignedTo) . "";?> - + bug->printAssignedHtml($bug, $users);?> resolvedBy);?> bug->resolutionList, $bug->resolution);?> id"; - common::printIcon('bug', 'assignTo', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index eb5c1e9c1b..3b5930ba33 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -48,14 +48,14 @@ task->project);?> task->name);?> openedByAB);?> - task->assignedTo);?> + task->assignedTo);?> task->finishedBy);?> task->estimateAB);?> task->consumedAB);?> task->leftAB);?> task->deadlineAB);?> statusAB);?> - actions;?> + actions;?> @@ -78,7 +78,7 @@ createLink('task', 'view', "taskID=$task->id"), $task->name, null, "style='color: $task->color'");?> openedBy);?> - " . zget($users, $task->assignedTo) . "";?> + task->printAssignedHtml($task, $users);?> finishedBy);?> estimate;?> consumed;?> @@ -94,8 +94,6 @@ } else { - common::printIcon('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $task, 'list', '', '', 'iframe', true); - if($task->status == 'wait') 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); if($task->status == 'done' or $task->status == 'cancel' or $task->status == 'closed') common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index 0afcb5c675..ec6cf88535 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -56,10 +56,10 @@ priAB);?> bug->title);?> openedByAB);?> - assignedToAB);?> + assignedToAB);?> bug->resolvedBy);?> bug->resolutionAB);?> - actions;?> + actions;?> @@ -76,19 +76,15 @@ pri?>' title='bug->priList, $bug->pri, $bug->pri)?>'>bug->priList, $bug->pri, $bug->pri)?> createLink('bug', 'view', "bugID=$bug->id"), $bug->title, null, "style='color: $bug->color'");?> openedBy, $bug->openedBy);?> - - assignedTo == $this->app->user->account ? 'text-red' : 'text-primary';?> - " . zget($users, $bug->assignedTo, $bug->assignedTo) . "";?> - + bug->printAssignedHtml($bug, $users);?> resolvedBy, $bug->resolvedBy);?> bug->resolutionList[$bug->resolution];?> id"; - common::printIcon('bug', 'assignTo', $params, $bug, 'list', '', '', 'iframe', true); - if($bug->status == 'active') common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); - if($bug->status == 'active') common::printIcon('bug', 'resolve', $params, $bug, 'list', 'check', '', 'iframe', true); - if($bug->status != 'active') common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); + common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); + common::printIcon('bug', 'resolve', $params, $bug, 'list', 'check', '', 'iframe', true); + common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); common::printIcon('bug', 'edit', $params, $bug, 'list'); ?> diff --git a/module/story/model.php b/module/story/model.php index d1a3f1c355..39b3123b75 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2398,7 +2398,9 @@ class storyModel extends model echo substr($story->openedDate, 5, 11); break; case 'assignedTo': - echo zget($users, $story->assignedTo, $story->assignedTo); + $assignedToText = zget($users, $story->assignedTo, $story->assignedTo); + $btnTextClass = ($story->assignedTo == $this->app->user->account) ? 'text-red' : ''; + echo "{$assignedToText}"; break; case 'assignedDate': echo substr($story->assignedDate, 5, 11); diff --git a/module/task/model.php b/module/task/model.php index 7a015125b4..d2fa544db4 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2447,22 +2447,7 @@ class taskModel extends model echo $task->realStarted; break; case 'assignedTo': - $btnTextClass = ''; - $assignedToText = zget($users, $task->assignedTo); - - if(empty($task->assignedTo)) - { - $btnTextClass = 'text-primary'; - $assignedToText = $this->lang->task->noAssigned; - } - if($task->assignedTo == $account) $btnTextClass = 'text-red'; - - $btnClass = $assignedToText == 'closed' ? ' disabled' : ''; - $btnClass = "iframe btn btn-icon-left btn-sm {$btnClass}"; - $assignToLink = helper::createLink('task', 'assignTo', "projectID=$task->project&taskID=$task->id", '', true); - $assignToHtml = html::a($assignToLink, " {$assignedToText}", '', "class='$btnClass'"); - - echo !common::hasPriv('task', 'assignTo') ? "{$assignedToText}" : $assignToHtml; + $this->printAssignedHtml($task, $users); break; case 'assignedDate': echo substr($task->assignedDate, 5, 11); @@ -2540,6 +2525,34 @@ class taskModel extends model } } + /** + * Print assigned html + * + * @param object $task + * @param array $users + * @access public + * @return void + */ + public function printAssignedHtml($task, $users) + { + $btnTextClass = ''; + $assignedToText = zget($users, $task->assignedTo); + + if(empty($task->assignedTo)) + { + $btnTextClass = 'text-primary'; + $assignedToText = $this->lang->task->noAssigned; + } + if($task->assignedTo == $this->app->user->account) $btnTextClass = 'text-red'; + + $btnClass = $assignedToText == 'closed' ? ' disabled' : ''; + $btnClass = "iframe btn btn-icon-left btn-sm {$btnClass}"; + $assignToLink = helper::createLink('task', 'assignTo', "projectID=$task->project&taskID=$task->id", '', true); + $assignToHtml = html::a($assignToLink, " {$assignedToText}", '', "class='$btnClass'"); + + echo !common::hasPriv('task', 'assignTo') ? "{$assignedToText}" : $assignToHtml; + } + /** * Send mail. * diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 96a019f21d..7dfcf6dbe8 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -11,3 +11,7 @@ /* Finish task #4751. */ .hide-sidebar #sidebar .cell{display:none;} + +.c-assignedTo.has-btn .icon-hand-right{font-size:14px;width:20px;height:20px;line-height:25px;} +.c-assignedTo.has-btn .btn-icon-left.btn-sm {padding-left: 20px;} +.table thead>tr>th.c-assign, .table thead>tr>th.c-assignedTo {padding-left: 27px;}