* Finish task#36884.

This commit is contained in:
leiyong
2021-03-23 17:49:48 +08:00
parent 923d87589e
commit 021233c8be
16 changed files with 103 additions and 114 deletions
+2 -3
View File
@@ -417,7 +417,7 @@ $lang->admin->menu->custom = array('link' => "{$lang->custom->common}|custom|
$lang->admin->menu->extension = array('link' => "{$lang->extension->common}|extension|browse", 'subModule' => 'extension');
$lang->admin->menu->dev = array('link' => "$lang->redev|dev|api", 'alias' => 'db', 'subModule' => 'dev,editor,entry');
$lang->admin->menu->message = array('link' => "{$lang->message->common}|message|index", 'subModule' => 'message,mail,webhook');
$lang->admin->menu->system = array('link' => "{$lang->admin->system}|backup|index", 'subModule' => 'cron,backup,action,admin', 'exclude' => 'admin-index');
$lang->admin->menu->system = array('link' => "{$lang->admin->system}|backup|index", 'subModule' => 'cron,backup,action,admin,search', 'exclude' => 'admin-index');
/* Admin menu order. */
$lang->admin->menuOrder[5] = 'index';
@@ -486,6 +486,7 @@ $lang->navGroup = new stdclass();
$lang->navGroup->my = 'my';
$lang->navGroup->effort = 'my';
$lang->navGroup->score = 'my';
$lang->navGroup->todo = 'my';
$lang->navGroup->program = 'program';
$lang->navGroup->personnel = 'program';
@@ -543,7 +544,6 @@ $lang->navGroup->company = 'system';
$lang->navGroup->sqlbuilder = 'system';
$lang->navGroup->auditcl = 'system';
$lang->navGroup->cmcl = 'system';
$lang->navGroup->todo = 'system';
$lang->navGroup->ldap = 'system';
$lang->navGroup->process = 'system';
$lang->navGroup->activity = 'system';
@@ -576,4 +576,3 @@ $lang->navGroup->dev = 'admin';
$lang->navGroup->entry = 'admin';
$lang->navGroup->extension = 'admin';
$lang->navGroup->action = 'admin';
$lang->navGroup->search = 'admin';
+6
View File
@@ -69,4 +69,10 @@ class index extends control
{
echo $this->fetch('misc', 'getsid');
}
public function ajaxClearObjectSession()
{
$objectType = $this->post->objectType;
$this->session->set($objectType . 'List', '');
}
}
+21 -49
View File
@@ -44,6 +44,20 @@
if(!defaultApp) defaultApp = item.code;
});
appsMap['search'] =
{
active: false,
code: "search",
group: "search",
icon: "icon-search",
methodName: "index",
moduleName: "search",
text: searchCommon,
title: "<i class='icon icon-search'></i> " + searchCommon,
url: "/index.php?m=search&f=index",
vars: ""
};
}
/**
@@ -135,6 +149,7 @@
return 'project';
}
}
if(moduleName === 'search' && methodLowerCase === 'buildindex') return 'admin';
code = window.navGroup[moduleName] || moduleName || urlOrModuleName;
return appsMap[code] ? code : '';
@@ -489,55 +504,9 @@
var $menu = $('#userNav .dropdown-menu').addClass('hidden');
setTimeout(function(){$menu.removeClass('hidden')}, 200);
});
/* Hide execution list on mouseleave or click */
$(document).click(function()
{
$("#moreExecution").hide();
});
$("#recentMenu").click(function(event)
{
$('#globalSearchInput').click();
event.stopPropagation();
getExecutions();
});
$("#moreExecution").click(function(event)
{
event.stopPropagation();
});
});
}());
/* Get recent executions. */
function getExecutions()
{
var $moreExecution = $('#moreExecution').toggle();
if(!$moreExecution.is(':hidden'))
{
if($('body').hasClass('menu-hide'))
{
$('#moreExecution').addClass('more-execution-hide');
}
else
{
$('#moreExecution').removeClass('more-execution-hide');
}
$.ajax(
{
url: createLink('execution', 'ajaxGetRecentExecutions'),
dataType: 'html',
type: 'post',
success: function(data)
{
$('#executionList').html(data);
}
})
}
}
$.extend(
{
gotoObject:function()
@@ -550,16 +519,19 @@ $.extend(
var reg = /[^0-9]/;
if(reg.test(objectValue) || objectType == 'all')
{
location.href = createLink('search', 'index') + (config.requestType == 'PATH_INFO' ? '?' : '&') + 'words=' + objectValue;
var searchLink = createLink('search', 'index') + (config.requestType == 'PATH_INFO' ? '?' : '&') + 'words=' + objectValue;
}
else
{
var types = objectType.split('-');
var searchModule = types[0];
var searchMethod = typeof(types[1]) == 'undefined' ? 'view' : types[1];
location.href = createLink(searchModule, searchMethod, "id=" + objectValue);
var searchLink = createLink(searchModule, searchMethod, "id=" + objectValue);
}
$.post(createLink('index', 'ajaxClearObjectSession'), {objectType: objectType});
$.apps.open(searchLink);
$('#globalSearchInput').click();
}
}
});
+4 -3
View File
@@ -1,7 +1,8 @@
<?php
$lang->index->common = 'Home';
$lang->index->index = 'Home';
$lang->index->search = 'Please input';
$lang->index->common = 'Home';
$lang->index->index = 'Home';
$lang->index->pleaseInput = 'Please input';
$lang->index->search = 'Search';
$lang->index->app = new stdClass();
$lang->index->app->open = 'Open';
+4 -3
View File
@@ -1,7 +1,8 @@
<?php
$lang->index->common = 'Home';
$lang->index->index = 'Home';
$lang->index->search = 'Please input';
$lang->index->common = 'Home';
$lang->index->index = 'Home';
$lang->index->pleaseInput = 'Please input';
$lang->index->search = 'Search';
$lang->index->app = new stdClass();
$lang->index->app->open = 'Open';
+4 -3
View File
@@ -1,7 +1,8 @@
<?php
$lang->index->common = 'Home';
$lang->index->index = 'Home';
$lang->index->search = 'Please input';
$lang->index->common = 'Home';
$lang->index->index = 'Home';
$lang->index->pleaseInput = 'Please input';
$lang->index->search = 'Search';
$lang->index->app = new stdClass();
$lang->index->app->open = 'Open';
+4 -3
View File
@@ -1,7 +1,8 @@
<?php
$lang->index->common = 'Home';
$lang->index->index = 'Home';
$lang->index->search = 'Please input';
$lang->index->common = 'Home';
$lang->index->index = 'Home';
$lang->index->pleaseInput = 'Please input';
$lang->index->search = 'Search';
$lang->index->app = new stdClass();
$lang->index->app->open = 'Open';
+4 -3
View File
@@ -1,7 +1,8 @@
<?php
$lang->index->common = '首页';
$lang->index->index = '首页';
$lang->index->search = '请输入';
$lang->index->common = '首页';
$lang->index->index = '首页';
$lang->index->pleaseInput = '请输入';
$lang->index->search = '搜索';
$lang->index->app = new stdClass();
$lang->index->app->open = '打开';
+4 -3
View File
@@ -1,7 +1,8 @@
<?php
$lang->index->common = '首頁';
$lang->index->index = '首頁';
$lang->index->search = '請輸入';
$lang->index->common = '首页';
$lang->index->index = '首页';
$lang->index->pleaseInput = '请输入';
$lang->index->search = '搜索';
$lang->index->app = new stdClass();
$lang->index->app->open = '打開';
+2 -1
View File
@@ -69,7 +69,7 @@ js::set('defaultOpen', $open);
<?php echo common::printSearchBox();?>
</div>
<div class="input-control search-box search-box-circle has-icon-left has-icon-right search-example" id="searchboxExample">
<input id="globalSearchInput" type="search" onclick="this.value=''" onkeydown="if(event.keyCode==13) $.gotoObject();" class="form-control search-input" placeholder="<?php echo $lang->index->search;?>" autocomplete="off">
<input id="globalSearchInput" type="search" onclick="this.value=''" onkeydown="if(event.keyCode==13) $.gotoObject();" class="form-control search-input" placeholder="<?php echo $lang->index->pleaseInput;?>" autocomplete="off">
</div>
<span class="input-group-btn" onclick="javascript:$.gotoObject();">
<button id="globalSearchButton" class="btn btn-secondary" type="button"><i class="icon icon-search"></i></button>
@@ -118,4 +118,5 @@ js::set('defaultOpen', $open);
</div>
<?php js::set('searchAB', $lang->searchAB);?>
<?php js::set('searchObjectList', ',' . implode(',', array_keys($lang->searchObjects)) . ',');?>
<?php js::set('searchCommon', $lang->index->search);?>
<?php include '../../common/view/footer.lite.html.php';?>
+4 -2
View File
@@ -488,8 +488,10 @@ class project extends control
*/
public function view($projectID = 0)
{
$project = $this->project->getById($projectID);
if(empty($project) || strpos('scrum,waterfall', $project->model) === false) die(js::error($this->lang->notFound) . js::locate('back'));
$this->project->setMenu($projectID);
$this->app->loadLang('bug');
$this->app->session->set('projectBrowse', $this->app->getURI(true));
@@ -507,7 +509,7 @@ class project extends control
$this->view->title = $this->lang->project->view;
$this->view->position = $this->lang->project->view;
$this->view->projectID = $projectID;
$this->view->project = $this->project->getByID($projectID);
$this->view->project = $project;
$this->view->products = $products;
$this->view->actions = $this->loadModel('action')->getList('project', $projectID);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
+17 -12
View File
@@ -157,7 +157,9 @@ class search extends control
}
}
$this->lang->search->menu = $this->lang->admin->menu;
$this->lang->navGroup->search = 'admin';
$this->lang->search->menu = $this->lang->admin->menu;
$this->lang->search->menuOrder = $this->lang->admin->menuOrder;
$this->view->title = $this->lang->search->buildIndex;
$this->display();
@@ -184,12 +186,15 @@ class search extends control
if(empty($type)) $type = $this->post->type;
if(empty($type) and ($recTotal != 0 or $pageID != 1)) $type = $this->session->searchIngType;
$type = (empty($type) or $type[0] == 'all') ? 'all' : $type;
//if($objectType != 'all') $type = explode('', $objectType);
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $this->config->search->recPerPage, $pageID);
$pager = new pager($recTotal, $this->config->search->recPerPage, $pageID);
$begin = time();
$result = $this->search->getList($words, $pager, $type);
/* Set session. */
$uri = inlink('index', "recTotal=$recTotal&pageID=$pageID");
$uri = inlink('index', "recTotal=$pager->recTotal&pageID=$pager->pageID");
$uri .= strpos($uri, '?') === false ? '?' : '&';
$uri .= 'words=' . $words;
$this->session->set('bugList', $uri);
@@ -198,6 +203,8 @@ class search extends control
$this->session->set('docList', $uri);
$this->session->set('productList', $uri);
$this->session->set('productPlanList', $uri);
$this->session->set('programList', $uri);
$this->session->set('projectList', $uri);
$this->session->set('executionList', $uri);
$this->session->set('releaseList', $uri);
$this->session->set('storyList', $uri);
@@ -212,20 +219,18 @@ class search extends control
$this->session->set('searchIngWord', $words);
$this->session->set('searchIngType', $type);
$begin = time();
$this->view->results = $this->search->getList($words, $pager, $type);
if(strpos($this->server->http_referer, 'search') === false)
{
$this->session->set('referer', $this->server->http_referer);
}
$this->view->consumed = time() - $begin;
$this->view->title = $this->lang->search->index;
$this->view->type = $type;
$this->view->pager = $pager;
$this->view->words = $words;
$this->view->referer = $this->session->referer;
$this->view->results = $result;
$this->view->consumed = time() - $begin;
$this->view->title = $this->lang->search->index;
$this->view->type = $type;
$this->view->pager = $pager;
$this->view->words = $words;
$this->view->referer = $this->session->referer;
$this->display();
}
+7 -13
View File
@@ -543,8 +543,6 @@ class searchModel extends model
if(common::hasPriv($module, 'view')) $allowedObject[] = $objectType;
if($module == 'caselib' and common::hasPriv('caselib', 'view')) $allowedObject[] = $objectType;
if($module == 'execution' and common::haspriv('project', 'view')) $allowedobject[] = $objectType;
if($module == 'project' and common::haspriv('program', 'index')) $allowedobject[] = $objectType;
if($module == 'deploystep' and common::haspriv('deploy', 'viewstep')) $allowedobject[] = $objectType;
}
}
@@ -578,7 +576,7 @@ class searchModel extends model
{
if(!isset($this->config->objectTables[$record->objectType])) continue;
$table = $this->config->objectTables[$record->objectType];
$projectID = $this->dao->select('project')->from($table)->where('id')->eq($record->objectID)->fetch('project');
$projectID = $this->dao->select('project')->from($table)->where('id')->eq($record->objectID)->fetch('project');
$record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, $projectID);
}
elseif($module == 'issue')
@@ -587,22 +585,18 @@ class searchModel extends model
$record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, $issue->project);
$record->extraType = empty($issue->owner) ? 'commonIssue' : 'stakeholderIssue';
}
elseif($module == 'execution')
{
$execution = $this->dao->select('id,type,project')->from(TABLE_EXECUTION)->where('id')->eq($record->objectID)->fetch();
$record->url = helper::createLink('execution', $method, "id={$record->objectID}", '', false, $execution->project);
$record->extraType = $execution->type;
}
elseif($module == 'story')
{
$story = $this->dao->select('id,type')->from(TABLE_STORY)->where('id')->eq($record->objectID)->fetch();
$record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, 0, true);
$record->extraType = $story->type;
}
elseif($module == 'execution')
{
$execution = $this->dao->select('id,type,project')->from(TABLE_PROJECT)->where('id')->eq($record->objectID)->fetch();
$record->url = helper::createLink('execution', $method, "id={$record->objectID}", '', false, $execution->project);
$record->extraType = $execution->type;
}
elseif($module == 'project')
{
$record->url = helper::createLink('project', 'index', "id={$record->objectID}", '', false, 0, true);
}
else
{
$record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, 0, true);
+19 -1
View File
@@ -1,4 +1,22 @@
<?php include '../../common/view/header.html.php';?>
<?php //include '../../common/view/header.html.php';?>
<?php include '../../common/view/header.lite.html.php';?>
<header id='header'>
<div id='mainHeader' style='height: 0px;'>
</div>
</header>
<?php
if(!empty($config->sso->redirect))
{
css::import($defaultTheme . 'bindranzhi.css');
js::import($jsRoot . 'bindranzhi.js');
}
?>
<script>
adjustMenuWidth();
</script>
<main id='main' <?php if(!empty($config->sso->redirect)) echo "class='ranzhiFixedTfootAction'";?> >
<div class='container'>
<div class='row'>
<div class='col-md-12'>
<form method='post' action='<?php echo inlink('index')?>' style='margin-bottom:10px;'>
-14
View File
@@ -381,21 +381,7 @@ class todo extends control
$this->locate($this->createLink('user', 'deny', "module=company&method=index"));
}
/* Set menus. */
$this->loadModel('user');
if($from == 'company')
{
$this->lang->todo->menu = $this->lang->user->menu;
$this->lang->todo->menuOrder = $this->lang->user->menuOrder;
$this->lang->company->menu->browseUser['subModule'] = 'todo';
}
elseif($from == 'my')
{
$this->lang->todo->menu = $this->lang->my->menu;
$this->lang->todo->menuOrder = $this->lang->my->menuOrder;
$this->loadModel('my')->setMenu();
$this->lang->my->menu->todo['subModule'] = 'todo';
}
$projects = $this->loadModel('project')->getPairsByModel('all');
if(!isset($this->session->project)) $this->session->set('project', key($projects));
+1 -1
View File
@@ -52,7 +52,7 @@
<td><?php echo $todo->date == '2030-01-01' ? $lang->todo->periods['future'] : $todo->date;?></td>
<td><?php echo $lang->todo->typeList[$todo->type];?></td>
<td><span class='<?php echo 'pri' . zget($lang->todo->priList, $todo->pri, $todo->pri);?>'><?php echo zget($lang->todo->priList, $todo->pri, $todo->pri);?></span></td>
<td class='text-left'><?php echo html::a($this->createLink('todo', 'view', "id=$todo->id", '', true), $todo->name, '', "class='iframe'");?></td>
<td class='text-left'><?php echo html::a($this->createLink('todo', 'view', "id=$todo->id&from=company", '', true), $todo->name, '', "class='iframe'");?></td>
<td><?php echo $todo->begin;?></td>
<td><?php echo $todo->end;?></td>
<td class='<?php echo $todo->status;?>'><?php echo $lang->todo->statusList[$todo->status];?></td>