This commit is contained in:
Catouse
2018-06-19 13:56:32 +08:00
8 changed files with 51 additions and 22 deletions
+8 -1
View File
@@ -39,7 +39,14 @@ class pager extends basePager
if(strtolower($key) == 'recperpage') $params[$key] = '{recPerPage}';
if(strtolower($key) == 'pageid') $params[$key] = '{page}';
}
echo "<ul class='pager' data-page-cookie='{$this->pageCookie}' data-ride='pager' data-rec-total='{$this->recTotal}' data-rec-per-page='{$this->recPerPage}' data-page='{$this->pageID}' data-link-creator='" . helper::createLink($this->moduleName, $this->methodName, $params) . "'></ul>";
if($this->recTotal == 0)
{
echo "<div class='pull-right'>" . $this->lang->pager->noRecord . '</div>';
}
else
{
echo "<ul class='pager' data-page-cookie='{$this->pageCookie}' data-ride='pager' data-rec-total='{$this->recTotal}' data-rec-per-page='{$this->recPerPage}' data-page='{$this->pageID}' data-link-creator='" . helper::createLink($this->moduleName, $this->methodName, $params) . "'></ul>";
}
}
else
{
+3 -3
View File
@@ -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;
+2
View File
@@ -30,7 +30,9 @@ if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
<?php common::printSearchBox();?>
<ul id="userNav" class="nav nav-default">
<?php list($adminName, $adminModule, $adminMethod) = explode('|', $lang->adminMenu);?>
<?php if(common::hasPriv($adminModule, $adminMethod)):?>
<li><?php echo html::a($this->createLink($adminModule, $adminMethod), $adminName);?></li>
<?php endif;?>
<li><?php common::printUserBar();?></li>
</ul>
</div>
+5 -2
View File
@@ -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);
+1 -1
View File
@@ -150,7 +150,7 @@
</tr>
<tr>
<th><?php echo $lang->doc->editedBy;?></th>
<td><?php echo $users[$doc->editedBy];?></td>
<td><?php echo zget($users, $doc->editedBy);?></td>
</tr>
<tr>
<th><?php echo $lang->doc->editedDate;?></th>
+31 -13
View File
@@ -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;
-1
View File
@@ -340,7 +340,6 @@
</div>
<div id="mainActions">
<?php echo $preAndNext;?>
<?php common::printPreAndNext($preAndNext);?>
<div class="btn-toolbar">
<?php common::printBack($browseLink);?>
+1 -1
View File
@@ -50,7 +50,7 @@
<th class='col-name required'><?php echo $lang->todo->name;?></th>
<th class='col-desc<?php echo zget($visibleFields, 'desc', ' hidden');?>'><?php echo $lang->todo->desc;?></th>
<th class='col-date<?php echo zget($visibleFields, 'beginAndEnd', ' hidden')?>'><?php echo $lang->todo->beginAndEnd;?></th>
<th class='w-60px'></th>
<th class='w-70px'></th>
</tr>
</thead>
<tbody>