From 6506886dc35d370e54a4f8fa6d6e94e728c15f54 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 19 Jun 2018 10:59:20 +0800 Subject: [PATCH] * adjust for ux. --- lib/pager/pager.class.php | 9 +++++- module/common/model.php | 6 ++-- module/common/view/header.html.php | 2 ++ module/doc/js/common.js | 7 +++-- module/doc/view/view.html.php | 2 +- module/product/model.php | 44 +++++++++++++++++++-------- module/task/view/view.html.php | 1 - module/todo/view/batchcreate.html.php | 2 +- 8 files changed, 51 insertions(+), 22 deletions(-) diff --git a/lib/pager/pager.class.php b/lib/pager/pager.class.php index 6fe29eee00..4a2d462b18 100644 --- a/lib/pager/pager.class.php +++ b/lib/pager/pager.class.php @@ -39,7 +39,14 @@ class pager extends basePager if(strtolower($key) == 'recperpage') $params[$key] = '{recPerPage}'; if(strtolower($key) == 'pageid') $params[$key] = '{page}'; } - echo ""; + if($this->recTotal == 0) + { + echo "
" . $this->lang->pager->noRecord . '
'; + } + else + { + echo ""; + } } else { diff --git a/module/common/model.php b/module/common/model.php index 8dd0837d47..a6ba541d53 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -144,23 +144,23 @@ class commonModel extends model { if($module == 'user' and strpos('login|logout|deny|reset', $method) !== false) return true; if($module == 'api' and $method == 'getsessionid') return true; - if($module == 'misc' and $method == 'ping') return true; if($module == 'misc' and $method == 'checktable') return true; if($module == 'misc' and $method == 'qrcode') return true; if($module == 'misc' and $method == 'about') return true; if($module == 'misc' and $method == 'checkupdate') return true; - if($module == 'misc' and $method == 'changelog') return true; if($module == 'sso' and $method == 'login') return true; if($module == 'sso' and $method == 'logout') return true; if($module == 'sso' and $method == 'bind') return true; if($module == 'sso' and $method == 'gettodolist') return true; - if($module == 'block' and $method == 'main') return true; if($module == 'file' and $method == 'read') return true; if($this->loadModel('user')->isLogon() or ($this->app->company->guest and $this->app->user->account == 'guest')) { if(stripos($method, 'ajax') !== false) return true; if(stripos($method, 'downnotify') !== false) return true; + if($module == 'block' and $method == 'main') return true; + if($module == 'misc' and $method == 'changelog') return true; + if($module == 'misc' and $method == 'ping') return true; if($module == 'tutorial') return true; if($module == 'block') return true; if($module == 'product' and $method == 'showerrornone') return true; diff --git a/module/common/view/header.html.php b/module/common/view/header.html.php index 698d663714..e93cac6476 100755 --- a/module/common/view/header.html.php +++ b/module/common/view/header.html.php @@ -30,7 +30,9 @@ if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile; diff --git a/module/doc/js/common.js b/module/doc/js/common.js index 9c2ad11877..b737d4b5e9 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -126,8 +126,11 @@ $(document).ready(function() var resizeCols = function() { var $cells = $cols.children('.panel,.cell').height('auto'); - var bestHeight = $firstCol.height(); - $cells.css('height', bestHeight); + if($firstCol.next('.col-spliter').css('display') != 'none') + { + var bestHeight = $firstCol.height(); + $cells.css('height', bestHeight); + } }; $element.find('.tree').on('resize', resizeCols); diff --git a/module/doc/view/view.html.php b/module/doc/view/view.html.php index d2ec17b346..e77b4da4d1 100644 --- a/module/doc/view/view.html.php +++ b/module/doc/view/view.html.php @@ -150,7 +150,7 @@ doc->editedBy;?> - editedBy];?> + editedBy);?> doc->editedDate;?> diff --git a/module/product/model.php b/module/product/model.php index 96d9950f49..9b5314afc5 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -869,18 +869,25 @@ class productModel extends model foreach($this->app->user->groups as $group) $groups .= ",$group,"; } - $stmt = $this->dao->select('distinct t1.*,t3.type as teamType,t3.account as teamAccount,t4.deleted as projectDeleted')->from(TABLE_PRODUCT)->alias('t1') - ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id = t2.product') - ->leftJoin(TABLE_TEAM)->alias('t3')->on('t2.project = t3.root') - ->leftJoin(TABLE_PROJECT)->alias('t4')->on('t2.project = t4.id') - ->where('t1.deleted')->eq(0) - ->query(); + $allProducts = $this->dao->select('*')->from(TABLE_PRODUCT)->where('deleted')->eq(0)->fetchAll('id'); + $productProjects = $this->dao->select('t1.product,t1.project')->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id') + ->where('t1.product')->in(array_keys($allProducts)) + ->andWhere('t2.deleted')->eq('0') + ->fetchGroup('product', 'project'); + + $linkedProjects = array(); + foreach($productProjects as $product => $projects) + { + foreach($projects as $projectID => $productProject) $linkedProjects[$projectID] = $projectID; + } + + $teams = $this->dao->select('root, account')->from(TABLE_TEAM)->where('root')->in($linkedProjects)->andWhere('type')->eq('project')->fetchGroup('root', 'account'); $products = array(); $account = $this->app->user->account; - while($product = $stmt->fetch()) + foreach($allProducts as $id => $product) { - $id = $product->id; if($this->app->user->admin) { $products[$id] = $id; @@ -892,22 +899,33 @@ class productModel extends model $products[$id] = $id; continue; } - if($product->teamType == 'project' and $product->teamAccount == $account and $product->projectDeleted == '0') - { - $products[$id] = $id; - continue; - } if($product->acl == 'open') { $products[$id] = $id; continue; } + + $hasPriv = false; if($product->acl == 'custom') { foreach(explode(',', $product->whitelist) as $whitelist) { if(empty($whitelist)) continue; if(strpos($groups, ",$whitelist,") !== false) + { + $products[$id] = $id; + $hasPriv = true; + break; + } + } + } + if($hasPriv) continue; + + if(!empty($productProjects[$id])) + { + foreach($productProjects[$id] as $projectID => $productProject) + { + if(isset($teams[$projectID][$account])) { $products[$id] = $id; break; diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index 483118c4f6..8037086d1a 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -340,7 +340,6 @@
-
diff --git a/module/todo/view/batchcreate.html.php b/module/todo/view/batchcreate.html.php index 7936ec4a2e..220a31bd67 100755 --- a/module/todo/view/batchcreate.html.php +++ b/module/todo/view/batchcreate.html.php @@ -50,7 +50,7 @@ todo->name;?> '>todo->desc;?> '>todo->beginAndEnd;?> - +