Merge branch 'sprint/201_tianshujie_56476' into 'master'
Sprint/201 tianshujie 56476 See merge request easycorp/zentaopms!3794
This commit is contained in:
@@ -67,3 +67,16 @@ $config->action->preferredTypeNum = 10;
|
||||
$config->action->preferredType = new stdclass();
|
||||
$config->action->preferredType->new = array('user', 'story', 'task', 'bug', 'case', 'doc', 'program', 'product', 'project', 'execution');
|
||||
$config->action->preferredType->classic = array('user', 'story', 'task', 'bug', 'case', 'doc', 'product', 'execution', 'productplan', 'build');
|
||||
|
||||
global $lang;
|
||||
$config->trash = new stdclass();
|
||||
$config->trash->search['module'] = 'trash';
|
||||
$config->trash->search['fields']['objectName'] = $lang->action->objectName;
|
||||
$config->trash->search['fields']['objectID'] = $lang->action->objectID;
|
||||
$config->trash->search['fields']['actor'] = $lang->action->actor;
|
||||
$config->trash->search['fields']['date'] = $lang->action->date;
|
||||
|
||||
$config->trash->search['params']['objectName'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
|
||||
$config->trash->search['params']['objectID'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
|
||||
$config->trash->search['params']['actor'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
|
||||
$config->trash->search['params']['date'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
|
||||
|
||||
@@ -40,6 +40,8 @@ class action extends control
|
||||
*
|
||||
* @param string $browseType
|
||||
* @param string $type all|hidden
|
||||
* @param bool $byQuery
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
@@ -47,7 +49,7 @@ class action extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function trash($browseType = 'all', $type = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function trash($browseType = 'all', $type = 'all', $byQuery = false, $queryID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->loadModel('backup');
|
||||
|
||||
@@ -81,13 +83,18 @@ class action extends control
|
||||
$this->session->set('practiceLibList', $uri, 'assetlib');
|
||||
$this->session->set('componentLibList', $uri, 'assetlib');
|
||||
|
||||
/* Build the search form. */
|
||||
$queryID = (int)$queryID;
|
||||
$actionURL = $this->createLink('action', 'trash', "browseType=$browseType&type=$type&byQuery=true&queryID=myQueryID");
|
||||
$this->action->buildTrashSearchForm($queryID, $actionURL);
|
||||
|
||||
/* Get deleted objects. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Append id for secend sort. */
|
||||
$sort = common::appendOrder($orderBy);
|
||||
$trashes = $this->action->getTrashes($browseType, $type, $sort, $pager);
|
||||
$trashes = $byQuery ? $this->action->getTrashesBySearch($browseType, $type, $queryID, $sort, $pager) : $this->action->getTrashes($browseType, $type, $sort, $pager);
|
||||
$objectTypeList = $this->action->getTrashObjectTypes($type);
|
||||
$objectTypeList = array_keys($objectTypeList);
|
||||
|
||||
@@ -96,6 +103,7 @@ class action extends control
|
||||
$preferredTypeConfig = $this->config->systemMode == 'new' ? $this->config->action->preferredType->new : $this->config->action->preferredType->classic;
|
||||
foreach($objectTypeList as $objectType)
|
||||
{
|
||||
if(!isset($this->config->objectTables[$objectType])) continue;
|
||||
in_array($objectType, $preferredTypeConfig) ? $preferredType[$objectType] = $objectType : $moreType[$objectType] = $objectType;
|
||||
}
|
||||
if(count($preferredType) < $this->config->action->preferredTypeNum)
|
||||
@@ -117,6 +125,9 @@ class action extends control
|
||||
$this->view->preferredType = $preferredType;
|
||||
$this->view->moreType = $moreType;
|
||||
$this->view->preferredTypeConfig = $preferredTypeConfig;
|
||||
$this->view->byQuery = $byQuery;
|
||||
$this->view->queryID = $queryID;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
.table-footer .table-actions {width: auto; visibility: visible; opacity: 1;}
|
||||
.table-footer .table-actions .text {line-height: 28px;}
|
||||
table tbody tr td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
#mainContent table tbody tr td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
|
||||
#mainMenu .btn-toolbar .btn-group .dropdown-menu .btn-active-text:hover .text {color: #fff}
|
||||
|
||||
.dropdown-menu .btn-active-text:hover .text:after {border-bottom: 0px;}
|
||||
#querybox #searchform{border-bottom: 1px solid #ddd; margin-bottom: 20px;}
|
||||
|
||||
@@ -42,6 +42,7 @@ $lang->action->hideAll = 'Hide All';
|
||||
$lang->action->editComment = 'Edit Comment';
|
||||
$lang->action->create = 'Add Comment';
|
||||
$lang->action->comment = 'Comment';
|
||||
$lang->action->byQuery = 'Search';
|
||||
|
||||
$lang->action->undeleteAction = 'Reset Data';
|
||||
$lang->action->hideOneAction = 'Hide Data';
|
||||
|
||||
@@ -42,6 +42,7 @@ $lang->action->hideAll = '全部隐藏';
|
||||
$lang->action->editComment = '修改备注';
|
||||
$lang->action->create = '添加备注';
|
||||
$lang->action->comment = '备注';
|
||||
$lang->action->byQuery = '搜索';
|
||||
|
||||
$lang->action->undeleteAction = '还原数据';
|
||||
$lang->action->hideOneAction = '隐藏数据';
|
||||
|
||||
@@ -683,6 +683,79 @@ class actionModel extends model
|
||||
return $trashes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get deleted objects by search.
|
||||
*
|
||||
* @param string $objectType
|
||||
* @param string $type all|hidden
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getTrashesBySearch($objectType, $type, $queryID, $orderBy, $pager = null)
|
||||
{
|
||||
if($queryID and $queryID != 'myQueryID')
|
||||
{
|
||||
$query = $this->loadModel('search')->getQuery($queryID);
|
||||
if($query)
|
||||
{
|
||||
$this->session->set('trashQuery', $query->sql);
|
||||
$this->session->set('trashForm', $query->form);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set('trashQuery', ' 1 = 1');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->session->trashQuery == false) $this->session->set('trashQuery', ' 1 = 1');
|
||||
}
|
||||
|
||||
$extra = $type == 'hidden' ? self::BE_HIDDEN : self::CAN_UNDELETED;
|
||||
$trashQuery = $this->session->trashQuery;
|
||||
$trashQuery = preg_replace("/`objectID`/", 't1.`objectID`', $trashQuery);
|
||||
$trashQuery = preg_replace("/`actor`/", 't1.`actor`', $trashQuery);
|
||||
$trashQuery = preg_replace("/`date`/", 't1.`date`', $trashQuery);
|
||||
$table = $this->config->objectTables[$objectType];
|
||||
$nameField = isset($this->config->action->objectNameFields[$objectType]) ? 't2.' . "`{$this->config->action->objectNameFields[$objectType]}`" : '';
|
||||
|
||||
if($nameField) $trashQuery = preg_replace("/`objectName`/", $nameField, $trashQuery);
|
||||
|
||||
if($objectType != 'pipeline')
|
||||
{
|
||||
$trashes = $this->dao->select("t1.*, $nameField as objectName")->from(TABLE_ACTION)->alias('t1')
|
||||
->leftJoin($table)->alias('t2')->on('t1.objectID=t2.id')
|
||||
->where('t1.action')->eq('deleted')
|
||||
->andWhere($trashQuery)
|
||||
->andWhere('t1.extra')->eq($extra)
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->beginIF($objectType != 'all')->andWhere('t1.objectType')->eq($objectType)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('objectID');
|
||||
}
|
||||
else
|
||||
{
|
||||
$trashes = $this->dao->select("t1.*, t1.objectType as type, t2.name as objectName, t2.type as objectType")->from(TABLE_ACTION)->alias('t1')
|
||||
->leftJoin(TABLE_PIPELINE)->alias('t2')->on('t1.objectID=t2.id')
|
||||
->where('t1.action')->eq('deleted')
|
||||
->andWhere($trashQuery)
|
||||
->andWhere('t1.extra')->eq($extra)
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->andWhere('(t2.type')->eq('gitlab')
|
||||
->orWhere('t2.type')->eq('jenkins')
|
||||
->markRight(1)
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('objectID');
|
||||
}
|
||||
|
||||
return $trashes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get object type list of trashes.
|
||||
*
|
||||
@@ -1931,4 +2004,20 @@ class actionModel extends model
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build search form.
|
||||
*
|
||||
* @param int $queryID
|
||||
* @param string $actionURL
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function buildTrashSearchForm($queryID, $actionURL)
|
||||
{
|
||||
$this->config->trash->search['actionURL'] = $actionURL;
|
||||
$this->config->trash->search['queryID'] = $queryID;
|
||||
|
||||
$this->loadModel('search')->setSearchParams($this->config->trash->search);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,17 +55,20 @@
|
||||
echo '</ul></div>';
|
||||
}
|
||||
?>
|
||||
<?php if($currentObjectType != 'all'):?>
|
||||
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->action->byQuery;?></a>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<?php if($type == 'hidden') echo html::a(inLink('trash', "browseType=all&type=all"), $lang->goback, '', "class='btn'");?>
|
||||
<?php if($type == 'all') echo html::a(inLink('trash', "browseType=all&type=hidden"), "<i class='icon-eye-close'></i> " . $lang->action->dynamic->hidden, '', "class='btn btn-danger'");?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cell<?php if($byQuery) echo ' show';?>" id="queryBox" data-module='trash'></div>
|
||||
<div id='mainContent' class="main-row">
|
||||
<div class='main-table' data-ride='table'>
|
||||
<table class='table has-sort-head'>
|
||||
<?php $vars = "browseType=$currentObjectType&type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<?php $vars = "browseType=$currentObjectType&type=$type&byQuery=$byQuery&queryID=$queryID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th class='c-object-type'><?php common::printOrderLink('objectType', $orderBy, $vars, $lang->action->objectType);?></th>
|
||||
|
||||
@@ -555,7 +555,7 @@ $('#modalTeam .btn').click(function()
|
||||
}
|
||||
else
|
||||
{
|
||||
if(config.onlybody == 'yes')
|
||||
if(config.onlybody == 'yes' && vision == 'lite')
|
||||
{
|
||||
$('.close').parent().click();
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<?php js::set('toTaskList', !empty($task->id));?>
|
||||
<?php js::set('blockID', $blockID);?>
|
||||
<?php js::set('teamMemberError', $lang->task->error->teamMember);?>
|
||||
<?php js::set('vision', $config->vision);?>
|
||||
<?php if(!empty($storyID)):?>
|
||||
<style> .title-group.required > .required:after {right: 110px;}</style>
|
||||
<?php endif;?>
|
||||
|
||||
Reference in New Issue
Block a user