diff --git a/module/block/model.php b/module/block/model.php index d3017d0beb..1544e1c370 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -157,14 +157,19 @@ class blockModel extends model { $data = array(); - $projects = $this->loadModel('project')->getPairs(); - $products = $this->loadModel('product')->getPairs(); - $data['tasks'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_TASK)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->fetch('count'); $data['bugs'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_BUG)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->fetch('count'); $data['stories'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_STORY)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->fetch('count'); - $data['projects'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PROJECT)->where('id')->in(array_keys($projects))->andWhere("(status='wait' or status='doing')")->andWhere('deleted')->eq(0)->fetch('count'); - $data['products'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PRODUCT)->where('status')->ne('closed')->andWhere('id')->in(array_keys($products))->andWhere('deleted')->eq(0)->fetch('count'); + $data['projects'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PROJECT) + ->where("(status='wait' or status='doing')") + ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects) + ->andWhere('deleted')->eq(0) + ->fetch('count'); + $data['products'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PRODUCT) + ->where('status')->ne('closed') + ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products) + ->andWhere('deleted')->eq(0) + ->fetch('count'); $today = date('Y-m-d'); $data['delayTask'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_TASK) @@ -182,8 +187,8 @@ class blockModel extends model ->andWhere('deleted')->eq(0) ->fetch('count'); $data['delayProject'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PROJECT) - ->where('id')->in(array_keys($projects)) - ->andWhere('status')->in('wait,doing') + ->where('status')->in('wait,doing') + ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects) ->andWhere('end')->lt($today) ->andWhere('deleted')->eq(0) ->fetch('count'); diff --git a/module/bug/config.php b/module/bug/config.php index 9c7e5ed1ef..038135ce14 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -324,5 +324,5 @@ $config->bug->datatable->fieldList['lastEditedDate']['required'] = 'no'; $config->bug->datatable->fieldList['actions']['title'] = 'actions'; $config->bug->datatable->fieldList['actions']['fixed'] = 'right'; -$config->bug->datatable->fieldList['actions']['width'] = '190'; +$config->bug->datatable->fieldList['actions']['width'] = '150'; $config->bug->datatable->fieldList['actions']['required'] = 'yes'; diff --git a/module/bug/model.php b/module/bug/model.php index 89e7bf41df..22f85cac73 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -422,10 +422,9 @@ class bugModel extends model */ public function getPlanBugs($planID, $status = 'all', $orderBy = 'id_desc', $pager = null) { - $projects = $this->loadModel('project')->getPairs('empty|withdelete'); $bugs = $this->dao->select('*')->from(TABLE_BUG) ->where('plan')->eq((int)$planID) - ->andWhere('project')->in(array_keys($projects)) + ->beginIF(!$this->app->user->admin)->andWhere('project')->in($this->app->user->view->projects)->fi() ->beginIF($status != 'all')->andWhere('status')->in($status)->fi() ->andWhere('deleted')->eq(0) ->orderBy($orderBy)->page($pager)->fetchAll('id'); @@ -1313,10 +1312,9 @@ class bugModel extends model public function getUserBugs($account, $type = 'assignedTo', $orderBy = 'id_desc', $limit = 0, $pager = null) { if(!$this->loadModel('common')->checkField(TABLE_BUG, $type)) return array(); - $projects = $this->loadModel('project')->getPairs('empty|withdelete'); - $bugs = $this->dao->select('*')->from(TABLE_BUG) + $bugs = $this->dao->select('*')->from(TABLE_BUG) ->where('deleted')->eq(0) - ->andWhere('project')->in(array_keys($projects)) + ->beginIF(!$this->app->user->admin)->andWhere('project')->in($this->app->user->view->projects)->fi() ->beginIF($type != 'all')->andWhere("`$type`")->eq($account)->fi() ->orderBy($orderBy) ->beginIF($limit > 0)->limit($limit)->fi() @@ -1459,11 +1457,10 @@ class bugModel extends model */ public function getProductBugPairs($productID) { - $projects = $this->loadModel('project')->getPairs('empty|withdelete'); $bugs = array('' => ''); $data = $this->dao->select('id, title')->from(TABLE_BUG) ->where('product')->eq((int)$productID) - ->andWhere('project')->in(array_keys($projects)) + ->beginIF(!$this->app->user->admin)->andWhere('project')->in($this->app->user->view->projects)->fi() ->andWhere('deleted')->eq(0) ->orderBy('id desc') ->fetchAll(); @@ -2584,9 +2581,17 @@ 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'; - echo "" . zget($users, $bug->assignedTo) . ""; + + $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; break; case 'assignedDate': echo substr($bug->assignedDate, 5, 11); @@ -2620,7 +2625,6 @@ class bugModel extends model break; case 'actions': $params = "bugID=$bug->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/product/model.php b/module/product/model.php index 610fc70410..d83ac6e391 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -591,7 +591,7 @@ class productModel extends model ->where('t1.product')->eq((int)$productID) ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi() - ->orderBy('t1.project desc') + ->andWhere('t2.deleted')->eq(0) ->fetchAll(); foreach($datas as $data) diff --git a/module/story/config.php b/module/story/config.php index c326e72761..9954b78fee 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -193,5 +193,5 @@ $config->story->datatable->fieldList['caseCount']['name'] = $lang->story->ca $config->story->datatable->fieldList['actions']['title'] = 'actions'; $config->story->datatable->fieldList['actions']['fixed'] = 'right'; -$config->story->datatable->fieldList['actions']['width'] = '190'; +$config->story->datatable->fieldList['actions']['width'] = '150'; $config->story->datatable->fieldList['actions']['required'] = 'yes'; diff --git a/module/task/config.php b/module/task/config.php index 930d81dd46..8893f55199 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -197,5 +197,5 @@ $config->task->datatable->fieldList['lastEditedDate']['required'] = 'no'; $config->task->datatable->fieldList['actions']['title'] = 'actions'; $config->task->datatable->fieldList['actions']['fixed'] = 'right'; -$config->task->datatable->fieldList['actions']['width'] = '180'; +$config->task->datatable->fieldList['actions']['width'] = '130'; $config->task->datatable->fieldList['actions']['required'] = 'yes'; diff --git a/module/task/model.php b/module/task/model.php index 88a18319fd..b5df21770c 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2450,8 +2450,20 @@ class taskModel extends model 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'; - echo "{$assignedToText}"; + + $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; break; case 'assignedDate': echo substr($task->assignedDate, 5, 11); @@ -2512,8 +2524,6 @@ class taskModel extends model break; } - 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/testcase/config.php b/module/testcase/config.php index e9dea174d1..181df64dba 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -204,6 +204,6 @@ $config->testcase->datatable->fieldList['stepNumber']['name'] = $lang->testc $config->testcase->datatable->fieldList['actions']['title'] = 'actions'; $config->testcase->datatable->fieldList['actions']['fixed'] = 'right'; -$config->testcase->datatable->fieldList['actions']['width'] = '190'; +$config->testcase->datatable->fieldList['actions']['width'] = '150'; $config->testcase->datatable->fieldList['actions']['required'] = 'yes'; $config->testcase->datatable->fieldList['actions']['sort'] = 'no'; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 934ca4e498..d9a863fa86 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -2428,6 +2428,8 @@ class upgradeModel extends model } } } + + $this->dao->delete()->from(TABLE_CONFIG)->where('module')->eq('common')->andWhere('section')->eq('customMenu')->andWhere('key')->eq('full_project')->exec(); return !dao::isError(); } diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 8c2fca4425..b2a0f67540 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -15,3 +15,11 @@ .main-content{padding:30px;} /* 详情页上一页下一页的样式*/ #nextPage, #prevPage{background-color:#909090;color:#fff} + +.table-header.fixed-right>.btn-toolbar{top:0px;} +.c-assignedTo .icon-hand-right {opacity:0;} +.c-assignedTo a:hover .icon-hand-right {opacity:1;} +.main-table tbody>tr:nth-child(odd) .c-assignedTo .btn{background-color:#f5f5f5;} +.main-table tbody>tr:hover .c-assignedTo .btn {background-color:#e9f2fb;} +.main-table tbody>tr>td.col-hover.c-assignedTo .btn {background-color:#e9f2fb;} +.main-table thead>tr>th.c-assignedTo {padding-left:35px;}