* finish task #3838.
This commit is contained in:
+51
-3
@@ -560,16 +560,19 @@ class actionModel extends model
|
||||
* @param object $pager
|
||||
* @param string|int $productID all|int(like 123)|notzero all => include zeror, notzero, great than 0
|
||||
* @param string|int $projectID same as productID
|
||||
* @param string $date
|
||||
* @param string $direction
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDynamic($account = 'all', $period = 'all', $orderBy = 'date_desc', $pager = null, $productID = 'all', $projectID = 'all')
|
||||
public function getDynamic($account = 'all', $period = 'all', $orderBy = 'date_desc', $pager = null, $productID = 'all', $projectID = 'all', $date = '', $direction = 'next')
|
||||
{
|
||||
/* Computer the begin and end date of a period. */
|
||||
$beginAndEnd = $this->computeBeginAndEnd($period);
|
||||
extract($beginAndEnd);
|
||||
|
||||
/* Build has priv condition. */
|
||||
$condition = 1;
|
||||
if($productID == 'all') $products = $this->loadModel('product')->getPairs();
|
||||
if($projectID == 'all') $projects = $this->loadModel('project')->getPairs();
|
||||
if($productID == 'all' or $projectID == 'all')
|
||||
@@ -594,6 +597,7 @@ class actionModel extends model
|
||||
->where(1)
|
||||
->beginIF($period != 'all')->andWhere('date')->gt($begin)->fi()
|
||||
->beginIF($period != 'all')->andWhere('date')->lt($end)->fi()
|
||||
->beginIF($date)->andWhere('date' . ($direction == 'next' ? '<' : '>') . "'{$date}'")->fi()
|
||||
->beginIF($account != 'all')->andWhere('actor')->eq($account)->fi()
|
||||
->beginIF(is_numeric($productID))->andWhere('product')->like("%,$productID,%")->fi()
|
||||
->beginIF(is_numeric($projectID))->andWhere('project')->eq($projectID)->fi()
|
||||
@@ -605,6 +609,8 @@ class actionModel extends model
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
|
||||
if(!$actions) return array();
|
||||
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'action');
|
||||
return $this->transformActions($actions);
|
||||
}
|
||||
|
||||
@@ -616,10 +622,12 @@ class actionModel extends model
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @param string $date
|
||||
* @param string $direction
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDynamicBySearch($products, $projects, $queryID, $orderBy = 'date_desc', $pager)
|
||||
public function getDynamicBySearch($products, $projects, $queryID, $orderBy = 'date_desc', $pager = null, $date = '', $direction = 'next')
|
||||
{
|
||||
$query = $queryID ? $this->loadModel('search')->getQuery($queryID) : '';
|
||||
|
||||
@@ -662,7 +670,9 @@ class actionModel extends model
|
||||
|
||||
$actionQuery = str_replace("`product` = '$productID'", "`product` LIKE '%,$productID,%'", $actionQuery);
|
||||
|
||||
if($date) $actionQuery = "($actionQuery) AND " . ('date' . ($direction == 'next' ? '<' : '>') . "'{$date}'");
|
||||
$actions = $this->getBySQL($actionQuery, $orderBy, $pager);
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'action');
|
||||
if(!$actions) return array();
|
||||
return $this->transformActions($actions);
|
||||
}
|
||||
@@ -980,10 +990,11 @@ class actionModel extends model
|
||||
* Build date group by actions
|
||||
*
|
||||
* @param array $actions
|
||||
* @param string $direction
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function buildDateGroup($actions)
|
||||
public function buildDateGroup($actions, $direction = 'next')
|
||||
{
|
||||
$dateGroup = array();
|
||||
foreach($actions as $action)
|
||||
@@ -994,6 +1005,43 @@ class actionModel extends model
|
||||
$dateGroup[$date][] = $action;
|
||||
}
|
||||
|
||||
if($dateGroup)
|
||||
{
|
||||
$lastDateActions = $this->dao->select('*')->from(TABLE_ACTION)->where($this->session->actionQueryCondition)->andWhere('`date`')->like(substr($action->originalDate, 0, 10) . '%')->orderBy($this->session->actionOrderBy)->fetchAll('id');
|
||||
if(count($dateGroup[$date]) < count($lastDateActions))
|
||||
{
|
||||
unset($dateGroup[$date]);
|
||||
$lastDateActions = $this->transformActions($lastDateActions);
|
||||
foreach($lastDateActions as $action)
|
||||
{
|
||||
$timeStamp = strtotime(isset($action->originalDate) ? $action->originalDate : $action->date);
|
||||
$date = date(DT_DATE4, $timeStamp);
|
||||
$action->time = date(DT_TIME2, $timeStamp);
|
||||
$dateGroup[$date][] = $action;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($direction != 'next') $dateGroup = array_reverse($dateGroup);
|
||||
return $dateGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Has pre or next.
|
||||
*
|
||||
* @param string $date
|
||||
* @param string $direction
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function hasPreOrNext($date, $direction = 'next')
|
||||
{
|
||||
$condition = $this->session->actionQueryCondition;
|
||||
/* Remove date condition for direction. */
|
||||
$condition = preg_replace("/AND +date[\<\>]'\d{4}\-\d{2}\-\d{2}'/", '', $condition);
|
||||
$count = $this->dao->select('count(*) as count')->from(TABLE_ACTION)->where($condition)
|
||||
->andWhere('date' . ($direction == 'next' ? '<' : '>') . "'{$date}'")
|
||||
->fetch('count');
|
||||
return $count > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ class company extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function dynamic($browseType = 'today', $param = '', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function dynamic($browseType = 'today', $param = '', $recTotal = 0, $date = '', $direction = 'next')
|
||||
{
|
||||
$this->company->setMenu();
|
||||
$this->app->loadLang('user');
|
||||
@@ -167,10 +167,11 @@ class company extends control
|
||||
|
||||
/* Set the pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
$pager = new pager($recTotal, $recPerPage = 50, $pageID = 1);
|
||||
|
||||
/* Append id for secend sort. */
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
$orderBy = $direction == 'next' ? 'date_desc' : 'date_asc';
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
|
||||
/* Set the user and type. */
|
||||
$account = $browseType == 'account' ? $param : 'all';
|
||||
@@ -178,6 +179,7 @@ class company extends control
|
||||
$project = $browseType == 'project' ? $param : 'all';
|
||||
$period = ($browseType == 'account' or $browseType == 'product' or $browseType == 'project') ? 'all' : $browseType;
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
$date = empty($date) ? '' : date('Y-m-d', $date);
|
||||
|
||||
/* Get products' list.*/
|
||||
$products = $this->loadModel('product')->getPairs('nocode');
|
||||
@@ -201,11 +203,11 @@ class company extends control
|
||||
/* Get actions. */
|
||||
if($browseType != 'bysearch')
|
||||
{
|
||||
$actions = $this->action->getDynamic($account, $period, $sort, $pager, $product, $project);
|
||||
$actions = $this->action->getDynamic($account, $period, $sort, $pager, $product, $project, $date, $direction);
|
||||
}
|
||||
else
|
||||
{
|
||||
$actions = $this->action->getDynamicBySearch($products, $projects, $queryID, $sort, $pager);
|
||||
$actions = $this->action->getDynamicBySearch($products, $projects, $queryID, $sort, $pager, $date, $direction);
|
||||
}
|
||||
|
||||
/* Build search form. */
|
||||
@@ -229,10 +231,12 @@ class company extends control
|
||||
$this->view->product = $product;
|
||||
$this->view->project = $project;
|
||||
$this->view->queryID = $queryID;
|
||||
$this->view->actions = $actions;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->param = $param;
|
||||
$this->view->dateGroups = $this->action->buildDateGroup($actions, $direction);
|
||||
$this->view->allCount = $this->action->getCount('all');
|
||||
$this->view->direction = $direction;
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,20 @@
|
||||
#featurebar ul.nav > li .chosen-container{height:20px;}
|
||||
#featurebar ul.nav > li .chosen-container a.chosen-single{background:#F8FAFE; border:none; -webkit-box-shadow:none;box-shadow:none; font-size:14px;padding-top:0px;}
|
||||
#featurebar ul.nav > li .chosen-container a.chosen-single div{top:-8px;}
|
||||
#featurebar ul.nav > li.active .chosen-container a.chosen-single{font-weight:bold}
|
||||
#featurebar ul.nav > li .chosen-container .chosen-drop {min-width: 300px;!important}
|
||||
#featurebar .nav > li > .chosen-container-single{top:-1px!important}
|
||||
#featurebar .nav > li > .chosen-container-single .chosen-single div{padding: 6px 22px!important}
|
||||
#dynamics {padding: 10px 0;}
|
||||
.dynamic {position: relative; padding-left: 170px;}
|
||||
.dynamic-date {position: absolute; left: 0; top: 0; width: 150px; border: 2px solid #eee; border-radius: 4px; padding: 14px 20px; height: 58px;}
|
||||
.dynamic-date:before {content: ' '; display: block; position: absolute; right: -22px; top: 26px; height: 2px; width: 20px; background-color: #eee;}
|
||||
.dynamic-date > .date-label,
|
||||
.dynamic-date > .date-text {font-size: 18px; display: block;}
|
||||
.dynamic-date > .date-label + .date-text {font-size: 14px; line-height: 14px;}
|
||||
.dynamic-date > .date-label {margin-top: -8px;}
|
||||
.dynamic-date > .btn {position: absolute; right: 10px; top: 15px;}
|
||||
.dynamic .timeline {border: 2px solid #eee; border-radius: 4px; margin-bottom: 20px; padding: 10px 20px 10px 100px; max-height: 800px; transition: max-height .2s; overflow: hidden;}
|
||||
.dynamic .timeline-tag {left: -75px; font-size: 14px; color: #838A9D;}
|
||||
.dynamic .timeline-text {color: #3C4353;}
|
||||
.dynamic .text-muted {color: #838A9D;}
|
||||
.dynamic .label-id {top: -1px;}
|
||||
.dynamic.active .timeline,
|
||||
.dynamic.active .dynamic-date {border-color: #00a9fc;}
|
||||
.dynamic.active .dynamic-date:before {background-color: #00a9fc;}
|
||||
.dynamic.collapsed .timeline {max-height: 58px;}
|
||||
.dynamic.collapsed .timeline > li + li:after {display: none;}
|
||||
.dynamic.collapsed .dynamic-btn > .icon:before {content: '\f0d7';}
|
||||
|
||||
@@ -11,60 +11,99 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<script language='Javascript'>
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
</script>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php
|
||||
echo '<li id="today">' . html::a(inlink('dynamic', "browseType=today"), $lang->action->dynamic->today) . '</li>';
|
||||
echo '<li id="yesterday">' . html::a(inlink('dynamic', "browseType=yesterday"), $lang->action->dynamic->yesterday) . '</li>';
|
||||
echo '<li id="twodaysago">' . html::a(inlink('dynamic', "browseType=twodaysago"), $lang->action->dynamic->twoDaysAgo) . '</li>';
|
||||
echo '<li id="thisweek">' . html::a(inlink('dynamic', "browseType=thisweek"), $lang->action->dynamic->thisWeek) . '</li>';
|
||||
echo '<li id="lastweek">' . html::a(inlink('dynamic', "browseType=lastweek"), $lang->action->dynamic->lastWeek) . '</li>';
|
||||
echo '<li id="thismonth">' . html::a(inlink('dynamic', "browseType=thismonth"), $lang->action->dynamic->thisMonth) . '</li>';
|
||||
echo '<li id="lastmonth">' . html::a(inlink('dynamic', "browseType=lastmonth"), $lang->action->dynamic->lastMonth) . '</li>';
|
||||
echo '<li id="all">' . html::a(inlink('dynamic', "browseType=all"), $lang->action->dynamic->all) . '</li>';
|
||||
echo "<li id='account'>" . html::select('account', $users, $account, 'onchange=changeUser(this.value) class="form-control chosen"') . '</li>';
|
||||
echo "<li id='product'>" . html::select('product', $products, $product, 'onchange=changeProduct(this.value) class="form-control chosen"') . '</li>';
|
||||
if($this->config->global->flow != 'onlyTest') echo "<li id='project' style='margin-right: 10px;'>" . html::select('project', $projects, $project, 'onchange=changeProject(this.value) class="form-control chosen"') . '</li>';
|
||||
echo "<li id='bysearchTab'>" . html::a('#', '<i class="icon-search icon"></i> ' . $lang->action->dynamic->search) . "</li>";
|
||||
echo html::a(inlink('dynamic', "browseType=all"), "<span class='text'>{$lang->action->dynamic->all}<span> <span class='label label-light label-badge'>{$allCount}</span>", '', "class='btn btn-link " . ($browseType == 'all' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "browseType=today"), "<span class='text'>{$lang->action->dynamic->today}<span>", '', "class='btn btn-link " . ($browseType == 'today' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "browseType=yesterday"), "<span class='text'>{$lang->action->dynamic->yesterday}<span>", '', "class='btn btn-link " . ($browseType == 'yesterday' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "browseType=thisweek"), "<span class='text'>{$lang->action->dynamic->thisWeek}<span>", '', "class='btn btn-link " . ($browseType == 'thisweek' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "browseType=lastweek"), "<span class='text'>{$lang->action->dynamic->lastWeek}<span>", '', "class='btn btn-link " . ($browseType == 'lastweek' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "browseType=thismonth"), "<span class='text'>{$lang->action->dynamic->thisMonth}<span>", '', "class='btn btn-link " . ($browseType == 'thismonth' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "browseType=lastmonth"), "<span class='text'>{$lang->action->dynamic->lastMonth}<span>", '', "class='btn btn-link " . ($browseType == 'lastmonth' ? 'btn-active-text' : '') . "'");
|
||||
?>
|
||||
</ul>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
<div class="input-control space w-150px"><?php echo html::select('account', $users, $account, 'onchange=changeUser(this.value) class="form-control chosen"');?></div>
|
||||
<div class="input-control space w-150px"><?php echo html::select('product', $products, $product, 'onchange=changeProduct(this.value) class="form-control chosen"');?></div>
|
||||
<?php if($this->config->global->flow != 'onlyTest'):?>
|
||||
<div class="input-control space w-150px"><?php echo html::select('project', $projects, $project, 'onchange=changeProject(this.value) class="form-control chosen"'); ?></div>
|
||||
<?php endif;?>
|
||||
<a class="btn btn-link querybox-toggle" id="bysearchTab"><i class="icon icon-search muted"></i> <?php echo $lang->action->dynamic->search;?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class='table table-condensed table-hover table-striped tablesorter table-fixed'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<?php $vars = "browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<th class='w-150px'><?php common::printOrderLink('date', $orderBy, $vars, $lang->action->date);?></th>
|
||||
<th class='w-user'> <?php common::printOrderLink('actor', $orderBy, $vars, $lang->action->actor);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('action', $orderBy, $vars, $lang->action->action);?></th>
|
||||
<th class='w-80px'> <?php common::printOrderLink('objectType', $orderBy, $vars, $lang->action->objectType);?></th>
|
||||
<th class='w-id'> <?php common::printOrderLink('objectID', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th><?php echo $lang->action->objectName;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($actions as $action):?>
|
||||
<?php $module = $action->objectType == 'case' ? 'testcase' : $action->objectType;?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $action->date;?></td>
|
||||
<td>
|
||||
<?php
|
||||
$actor = isset($users[$action->actor]) ? $users[$action->actor] : $action->actor;
|
||||
echo strpos($actor, ':') === false ? $actor : substr($actor, strpos($actor, ':') + 1);
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $action->actionLabel;?></td>
|
||||
<td><?php echo $lang->action->objectTypes[$action->objectType];?></td>
|
||||
<td><?php echo $action->objectID;?></td>
|
||||
<td class='text-left'><?php echo html::a($action->objectLink, $action->objectName);?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<tfoot><tr><td colspan='6'><?php $pager->show();?></td></tr></tfoot>
|
||||
</table>
|
||||
<script>$('#<?php echo $browseType;?>').addClass('active')</script>
|
||||
<div id="mainContent" class="main-content">
|
||||
<div id='queryBox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
<div id="dynamics">
|
||||
<?php $firstAction = '';?>
|
||||
<?php foreach($dateGroups as $date => $actions):?>
|
||||
<?php $isToday = date(DT_DATE4) == $date;?>
|
||||
<div class="dynamic <?php if($isToday) echo 'active';?>">
|
||||
<div class="dynamic-date">
|
||||
<?php if($isToday):?>
|
||||
<span class="date-label"><?php echo $lang->action->dynamic->today;?></span>
|
||||
<?php endif;?>
|
||||
<span class="date-text"><?php echo $date;?></span>
|
||||
<button type="button" class="btn btn-info btn-icon btn-sm dynamic-btn"><i class="icon icon-caret-up"></i></button>
|
||||
</div>
|
||||
<ul class="timeline timeline-tag-left">
|
||||
<?php if($direction == 'next') $actions = array_reverse($actions);?>
|
||||
<?php foreach($actions as $i => $action):?>
|
||||
<?php if(empty($firstAction)) $firstAction = $action;?>
|
||||
<li <?php if($action->actor == $this->app->user->account) echo "class='active'";?>>
|
||||
<div>
|
||||
<span class="timeline-tag"><?php echo $action->time?></span>
|
||||
<span class="timeline-text">
|
||||
<?php echo zget($users, $action->actor) . ' ' . $action->actionLabel;?>
|
||||
<span class="text-muted"><?php echo $action->objectLabel;?></span>
|
||||
<span class="label label-id"><?php echo $action->objectID;?></span>
|
||||
<?php echo html::a($action->objectLink, $action->objectName);?>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php if(!empty($firstAction)):?>
|
||||
<?php
|
||||
$firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600);
|
||||
$lastDate = substr($action->originalDate, 0, 10);
|
||||
$hasPre = $this->action->hasPreOrNext($firstDate, 'pre');
|
||||
$hasNext = $this->action->hasPreOrNext($lastDate, 'next');
|
||||
?>
|
||||
<?php if($hasPre or $hasNext):?>
|
||||
<div class='table-footer'>
|
||||
<ul class='pager'>
|
||||
<?php $class = $hasPre ? '' : 'disabled';?>
|
||||
<li class='<?php echo $class;?> pager-item-left'>
|
||||
<?php
|
||||
$link = '###';
|
||||
if($hasPre) $link = inlink('dynamic', "browseType=$browseType¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre');
|
||||
echo html::a($link, '<i class="icon icon-angle-left"></i>', '', "class='pager-item'");
|
||||
?>
|
||||
</li>
|
||||
<?php $class = $hasNext ? '' : 'disabled';?>
|
||||
<li class='<?php echo $class;?> pager-item-left'>
|
||||
<?php
|
||||
$link = '###';
|
||||
if($hasNext) $link = inlink('dynamic', "browseType=$browseType¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($lastDate) . '&direction=next');
|
||||
echo html::a($link, '<i class="icon icon-angle-right"></i>', '', "class='pager-item'");
|
||||
?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<script>
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
$(function()
|
||||
{
|
||||
$('#dynamics').on('click', '.dynamic-btn', function()
|
||||
{
|
||||
$(this).closest('.dynamic').toggleClass('collapsed');
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -533,7 +533,7 @@ class my extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function dynamic($type = 'today', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 50, $pageID = 1)
|
||||
public function dynamic($type = 'today', $recTotal = 0, $date = '', $direction = 'next')
|
||||
{
|
||||
/* Save session. */
|
||||
$uri = $this->app->getURI(true);
|
||||
@@ -550,27 +550,26 @@ class my extends control
|
||||
|
||||
/* Set the pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
$pager = new pager($recTotal, $recPerPage = 50, $pageID = 1);
|
||||
|
||||
/* Append id for secend sort. */
|
||||
$orderBy = $direction == 'next' ? 'date_desc' : 'date_asc';
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
|
||||
/* The header and position. */
|
||||
$this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->dynamic;
|
||||
$this->view->position[] = $this->lang->my->dynamic;
|
||||
|
||||
$actions = $this->loadModel('action')->getDynamic($this->app->user->account, $type, $sort, $pager);
|
||||
$date = empty($date) ? '' : date('Y-m-d', $date);
|
||||
$actions = $this->loadModel('action')->getDynamic($this->app->user->account, $type, $sort, $pager, 'all', 'all', $date, $direction);
|
||||
|
||||
/* Assign. */
|
||||
$this->view->type = $type;
|
||||
$this->view->recTotal = $recTotal;
|
||||
$this->view->recPerPage = $recPerPage;
|
||||
$this->view->pageID = $pageID;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->actions = $this->loadModel('action')->getDynamic($this->app->user->account, $type, $sort, $pager);
|
||||
$this->view->dateGroups = $this->action->buildDateGroup($actions);
|
||||
$this->view->dateGroups = $this->action->buildDateGroup($actions, $direction);
|
||||
$this->view->allCount = $this->action->getCount();
|
||||
$this->view->direction = $direction;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
</div>
|
||||
<div id="mainContent" class="main-content">
|
||||
<div id="dynamics">
|
||||
<?php $firstAction = '';?>
|
||||
<?php foreach($dateGroups as $date => $actions):?>
|
||||
<?php $isToday = date(DT_DATE4) == $date;?>
|
||||
<div class="dynamic <?php if($isToday) echo 'active';?>">
|
||||
@@ -37,15 +38,54 @@
|
||||
<button type="button" class="btn btn-info btn-icon btn-sm dynamic-btn"><i class="icon icon-caret-up"></i></button>
|
||||
</div>
|
||||
<ul class="timeline timeline-tag-left">
|
||||
<?php if($direction == 'next') $actions = array_reverse($actions);?>
|
||||
<?php foreach($actions as $i => $action):?>
|
||||
<li <?php if($i % 3 == 0) echo "class='active'";?>><div><span class="timeline-tag"><?php echo $action->time?></span><span class="timeline-text"><?php echo $app->user->realname . ' ' . $action->actionLabel;?> <span class="text-muted"><?php echo $action->objectLabel;?></span> <span class="label label-id"><?php echo $action->objectID;?></span> <?php echo html::a($action->objectLink, $action->objectName);?></span></div></li>
|
||||
<?php if(empty($firstAction)) $firstAction = $action;?>
|
||||
<li <?php if($action->actor == $this->app->user->account) echo "class='active'";?>>
|
||||
<div>
|
||||
<span class="timeline-tag"><?php echo $action->time?></span>
|
||||
<span class="timeline-text">
|
||||
<?php echo $app->user->realname . ' ' . $action->actionLabel;?>
|
||||
<span class="text-muted"><?php echo $action->objectLabel;?></span>
|
||||
<span class="label label-id"><?php echo $action->objectID;?></span>
|
||||
<?php echo html::a($action->objectLink, $action->objectName);?>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php if($pager->recTotal > $pager->recPerPage):?>
|
||||
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
|
||||
<?php if(!empty($firstAction)):?>
|
||||
<?php
|
||||
$firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600);
|
||||
$lastDate = substr($action->originalDate, 0, 10);
|
||||
$hasPre = $this->action->hasPreOrNext($firstDate, 'pre');
|
||||
$hasNext = $this->action->hasPreOrNext($lastDate, 'next');
|
||||
?>
|
||||
<?php if($hasPre or $hasNext):?>
|
||||
<div class='table-footer'>
|
||||
<ul class='pager'>
|
||||
<?php $class = $hasPre ? '' : 'disabled';?>
|
||||
<li class='<?php echo $class;?> pager-item-left'>
|
||||
<?php
|
||||
$link = '###';
|
||||
if($hasPre) $link = inlink('dynamic', "type=$type&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre');
|
||||
echo html::a($link, '<i class="icon icon-angle-left"></i>', '', "class='pager-item'");
|
||||
?>
|
||||
</li>
|
||||
<?php $class = $hasNext ? '' : 'disabled';?>
|
||||
<li class='<?php echo $class;?> pager-item-left'>
|
||||
<?php
|
||||
$link = '###';
|
||||
if($hasNext) $link = inlink('dynamic', "type=$type&recTotal={$pager->recTotal}&date=" . strtotime($lastDate) . '&direction=next');
|
||||
echo html::a($link, '<i class="icon icon-angle-right"></i>', '', "class='pager-item'");
|
||||
?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
@@ -471,7 +471,7 @@ class product extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function dynamic($productID = 0, $type = 'today', $param = '', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 50, $pageID = 1, $lastDate = '')
|
||||
public function dynamic($productID = 0, $type = 'today', $param = '', $recTotal = 0, $date = '', $direction = 'next')
|
||||
{
|
||||
/* Save session. */
|
||||
$uri = $this->app->getURI(true);
|
||||
@@ -489,17 +489,18 @@ class product extends control
|
||||
$this->product->setMenu($this->products, $productID);
|
||||
|
||||
/* Append id for secend sort. */
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
$orderBy = $direction == 'next' ? 'date_desc' : 'date_asc';
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
if($this->app->getViewType() == 'mhtml') $recPerPage = 10;
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$pager = new pager($recTotal, $recPerPage = 50, $pageID = 1);
|
||||
|
||||
/* Set the user and type. */
|
||||
$account = $type == 'account' ? $param : 'all';
|
||||
$period = $type == 'account' ? 'all' : $type;
|
||||
$actions = $this->loadModel('action')->getDynamic($account, $period, $sort, $pager, $productID, $lastDate);
|
||||
$date = empty($date) ? '' : date('Y-m-d', $date);
|
||||
$actions = $this->loadModel('action')->getDynamic($account, $period, $sort, $pager, $productID, 'all', $date, $direction);
|
||||
|
||||
/* The header and position. */
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->product->dynamic;
|
||||
@@ -514,8 +515,9 @@ class product extends control
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->param = $param;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->dateGroups = $this->action->buildDateGroup($actions);
|
||||
$this->view->dateGroups = $this->action->buildDateGroup($actions, $direction);
|
||||
$this->view->allCount = $this->action->getCount('product', $productID);
|
||||
$this->view->direction = $direction;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,12 +23,13 @@
|
||||
echo html::a(inlink('dynamic', "productID=$productID&type=lastmonth"), "<span class='text'>{$lang->action->dynamic->lastMonth}</span>", '', "class='btn btn-link " . ($type == 'lastmonth' ? 'btn-active-text' : '') . "'");
|
||||
?>
|
||||
<div class="input-control space w-150px">
|
||||
<?php echo html::select('account', $users, $account, "onchange='changeUser(this.value,$productID)' class='form-control chosen'");?>
|
||||
<?php echo html::select('account', $users, $account, "onchange='changeUser(this.value, $productID)' class='form-control chosen'");?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent" class="main-content">
|
||||
<div id="dynamics">
|
||||
<?php $firstAction = '';?>
|
||||
<?php foreach($dateGroups as $date => $actions):?>
|
||||
<?php $isToday = date(DT_DATE4) == $date;?>
|
||||
<div class="dynamic <?php if($isToday) echo 'active';?>">
|
||||
@@ -40,15 +41,54 @@
|
||||
<button type="button" class="btn btn-info btn-icon btn-sm dynamic-btn"><i class="icon icon-caret-up"></i></button>
|
||||
</div>
|
||||
<ul class="timeline timeline-tag-left">
|
||||
<?php if($direction == 'next') $actions = array_reverse($actions);?>
|
||||
<?php foreach($actions as $i => $action):?>
|
||||
<li <?php if($action->actor == $this->app->user->account) echo "class='active'";?>><div><span class="timeline-tag"><?php echo $action->time?></span><span class="timeline-text"><?php echo $app->user->realname . ' ' . $action->actionLabel;?> <span class="text-muted"><?php echo $action->objectLabel;?></span> <span class="label label-id"><?php echo $action->objectID;?></span> <?php echo html::a($action->objectLink, $action->objectName);?></span></div></li>
|
||||
<?php if(empty($firstAction)) $firstAction = $action;?>
|
||||
<li <?php if($action->actor == $this->app->user->account) echo "class='active'";?>>
|
||||
<div>
|
||||
<span class="timeline-tag"><?php echo $action->time?></span>
|
||||
<span class="timeline-text">
|
||||
<?php echo zget($users, $action->actor) . ' ' . $action->actionLabel;?>
|
||||
<span class="text-muted"><?php echo $action->objectLabel;?></span>
|
||||
<span class="label label-id"><?php echo $action->objectID;?></span>
|
||||
<?php echo html::a($action->objectLink, $action->objectName);?>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php if($pager->recTotal > $pager->recPerPage):?>
|
||||
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
|
||||
<?php if(!empty($firstAction)):?>
|
||||
<?php
|
||||
$firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600);
|
||||
$lastDate = substr($action->originalDate, 0, 10);
|
||||
$hasPre = $this->action->hasPreOrNext($firstDate, 'pre');
|
||||
$hasNext = $this->action->hasPreOrNext($lastDate, 'next');
|
||||
?>
|
||||
<?php if($hasPre or $hasNext):?>
|
||||
<div class='table-footer'>
|
||||
<ul class='pager'>
|
||||
<?php $class = $hasPre ? '' : 'disabled';?>
|
||||
<li class='<?php echo $class;?> pager-item-left'>
|
||||
<?php
|
||||
$link = '###';
|
||||
if($hasPre) $link = inlink('dynamic', "productID=$productID&type=$type¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre');
|
||||
echo html::a($link, '<i class="icon icon-angle-left"></i>', '', "class='pager-item'");
|
||||
?>
|
||||
</li>
|
||||
<?php $class = $hasNext ? '' : 'disabled';?>
|
||||
<li class='<?php echo $class;?> pager-item-left'>
|
||||
<?php
|
||||
$link = '###';
|
||||
if($hasNext) $link = inlink('dynamic', "productID=$productID&type=$type¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($lastDate) . '&direction=next');
|
||||
echo html::a($link, '<i class="icon icon-angle-right"></i>', '', "class='pager-item'");
|
||||
?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
+16
-11
@@ -1903,7 +1903,7 @@ class project extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function dynamic($projectID = 0, $type = 'today', $param = '', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function dynamic($projectID = 0, $type = 'today', $param = '', $recTotal = 0, $date = '', $direction = 'next')
|
||||
{
|
||||
/* Save session. */
|
||||
$uri = $this->app->getURI(true);
|
||||
@@ -1922,7 +1922,8 @@ class project extends control
|
||||
if(!isset($this->projects[$projectID])) $projectID = key($this->projects);
|
||||
|
||||
/* Append id for secend sort. */
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
$orderBy = $direction == 'next' ? 'date_desc' : 'date_asc';
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
|
||||
/* Set the menu. If the projectID = 0, use the indexMenu instead. */
|
||||
$this->project->setMenu($this->projects, $projectID);
|
||||
@@ -1936,11 +1937,13 @@ class project extends control
|
||||
|
||||
/* Set the pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
$pager = new pager($recTotal, $recPerPage = 50, $pageID = 1);
|
||||
|
||||
/* Set the user and type. */
|
||||
$account = $type == 'account' ? $param : 'all';
|
||||
$period = $type == 'account' ? 'all' : $type;
|
||||
$date = empty($date) ? '' : date('Y-m-d', $date);
|
||||
$actions = $this->loadModel('action')->getDynamic($account, $period, $sort, $pager, 'all', $projectID, $date, $direction);
|
||||
|
||||
/* The header and position. */
|
||||
$project = $this->project->getByID($projectID);
|
||||
@@ -1949,14 +1952,16 @@ class project extends control
|
||||
$this->view->position[] = $this->lang->project->dynamic;
|
||||
|
||||
/* Assign. */
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->type = $type;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted');
|
||||
$this->view->account = $account;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->param = $param;
|
||||
$this->view->actions = $this->loadModel('action')->getDynamic($account, $period, $sort, $pager, 'all', $projectID);
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->type = $type;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted');
|
||||
$this->view->account = $account;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->param = $param;
|
||||
$this->view->dateGroups = $this->action->buildDateGroup($actions, $direction);
|
||||
$this->view->allCount = $this->action->getCount('project', $projectID);
|
||||
$this->view->direction = $direction;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
.dropdown-menu.with-search {padding: 0; min-width: 150px; overflow: hidden; max-height: 302px;}
|
||||
.dropdown-menu > .menu-search .input-group {width:100%;}
|
||||
.dropdown-menu > .menu-search .input-group-addon {position: absolute; right: 10px; top: 0; z-index: 10; background: none; border: none; color: #666}
|
||||
.dropdown-menu > .menu-search .form-control {border: none!important; box-shadow: none!important; border-top: 1px solid #ddd!important;}
|
||||
.dropdown-list {display: block; padding: 0; max-height: 270px; overflow-y: auto;}
|
||||
.dropdown-list > li > a {display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.53846154; color: #141414; white-space: nowrap;}
|
||||
.dropdown-list > li > a:hover,
|
||||
.dropdown-list > li > a:focus {color: #1a4f85;text-decoration: none;background-color: #ddd;}
|
||||
#dynamics {padding: 10px 0;}
|
||||
.dynamic {position: relative; padding-left: 170px;}
|
||||
.dynamic-date {position: absolute; left: 0; top: 0; width: 150px; border: 2px solid #eee; border-radius: 4px; padding: 14px 20px; height: 58px;}
|
||||
.dynamic-date:before {content: ' '; display: block; position: absolute; right: -22px; top: 26px; height: 2px; width: 20px; background-color: #eee;}
|
||||
.dynamic-date > .date-label,
|
||||
.dynamic-date > .date-text {font-size: 18px; display: block;}
|
||||
.dynamic-date > .date-label + .date-text {font-size: 14px; line-height: 14px;}
|
||||
.dynamic-date > .date-label {margin-top: -8px;}
|
||||
.dynamic-date > .btn {position: absolute; right: 10px; top: 15px;}
|
||||
.dynamic .timeline {border: 2px solid #eee; border-radius: 4px; margin-bottom: 20px; padding: 10px 20px 10px 100px; max-height: 800px; transition: max-height .2s; overflow: hidden;}
|
||||
.dynamic .timeline-tag {left: -75px; font-size: 14px; color: #838A9D;}
|
||||
.dynamic .timeline-text {color: #3C4353;}
|
||||
.dynamic .text-muted {color: #838A9D;}
|
||||
.dynamic .label-id {top: -1px;}
|
||||
.dynamic.active .timeline,
|
||||
.dynamic.active .dynamic-date {border-color: #00a9fc;}
|
||||
.dynamic.active .dynamic-date:before {background-color: #00a9fc;}
|
||||
.dynamic.collapsed .timeline {max-height: 58px;}
|
||||
.dynamic.collapsed .timeline > li + li:after {display: none;}
|
||||
.dynamic.collapsed .dynamic-btn > .icon:before {content: '\f0d7';}
|
||||
|
||||
@@ -11,67 +11,94 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php
|
||||
echo '<li id="today">' . html::a(inlink('dynamic', "projectID=$projectID&type=today"), $lang->action->dynamic->today) . '</li>';
|
||||
echo '<li id="yesterday">' . html::a(inlink('dynamic', "projectID=$projectID&type=yesterday"), $lang->action->dynamic->yesterday) . '</li>';
|
||||
echo '<li id="twodaysago">' . html::a(inlink('dynamic', "projectID=$projectID&type=twodaysago"), $lang->action->dynamic->twoDaysAgo) . '</li>';
|
||||
echo '<li id="thisweek">' . html::a(inlink('dynamic', "projectID=$projectID&type=thisweek"), $lang->action->dynamic->thisWeek) . '</li>';
|
||||
echo '<li id="lastweek">' . html::a(inlink('dynamic', "projectID=$projectID&type=lastweek"), $lang->action->dynamic->lastWeek) . '</li>';
|
||||
echo '<li id="thismonth">' . html::a(inlink('dynamic', "projectID=$projectID&type=thismonth"), $lang->action->dynamic->thisMonth) . '</li>';
|
||||
echo '<li id="lastmonth">' . html::a(inlink('dynamic', "projectID=$projectID&type=lastmonth"), $lang->action->dynamic->lastMonth) . '</li>';
|
||||
echo '<li id="all">' . html::a(inlink('dynamic', "projectID=$projectID&type=all"), $lang->action->dynamic->all) . '</li>';
|
||||
// echo "<li id='account'>" . html::select('account', $users, $account, "onchange=changeUser(this.value,$projectID)") . '</li>';
|
||||
|
||||
$withSearch = count($users) > 10;
|
||||
echo "<li id='account' class='dropdown'>";
|
||||
$current = zget($users, isset($account) ? $account : '', '');
|
||||
if(empty($current)) $current = $lang->project->byUser;
|
||||
echo html::a('javascript:;', $current . " <span class='caret'></span>", '', "data-toggle='dropdown'");
|
||||
echo "<div class='dropdown-menu" . ($withSearch ? ' with-search':'') . "'>";
|
||||
echo '<ul class="dropdown-list">';
|
||||
foreach ($users as $key => $value)
|
||||
{
|
||||
echo '<li' . ($key == $account ? " class='active'" : '') . '>';
|
||||
if($key == '') echo html::a($this->createLink('project', 'dynamic', "projectID=$projectID&type=all"), $lang->project->all);
|
||||
else echo html::a($this->createLink('project', 'dynamic', "projectID=$projectID&type=account¶m=$key"), $value);
|
||||
echo '</li>';
|
||||
}
|
||||
echo "</ul>";
|
||||
echo "</div></li>";
|
||||
echo html::a(inlink('dynamic', "projectID=$projectID&type=all"), "<span class='text'>{$lang->action->dynamic->all}</span> <span class='label label-light label-badge'>{$allCount}</span>", '', "class='btn btn-link " . ($type == 'all' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "projectID=$projectID&type=today"), "<span class='text'>{$lang->action->dynamic->today}</span>", '', "class='btn btn-link " . ($type == 'today' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "projectID=$projectID&type=yesterday"), "<span class='text'>{$lang->action->dynamic->yesterday}</span>", '', "class='btn btn-link " . ($type == 'yesterday' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "projectID=$projectID&type=thisweek"), "<span class='text'>{$lang->action->dynamic->thisWeek}</span>", '', "class='btn btn-link " . ($type == 'thisweek' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "projectID=$projectID&type=lastweek"), "<span class='text'>{$lang->action->dynamic->lastWeek}</span>", '', "class='btn btn-link " . ($type == 'lastweek' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "projectID=$projectID&type=thismonth"), "<span class='text'>{$lang->action->dynamic->thisMonth}</span>", '', "class='btn btn-link " . ($type == 'thismonth' ? 'btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('dynamic', "projectID=$projectID&type=lastmonth"), "<span class='text'>{$lang->action->dynamic->lastMonth}</span>", '', "class='btn btn-link " . ($type == 'lastmonth' ? 'btn-active-text' : '') . "'");
|
||||
?>
|
||||
</ul>
|
||||
<div class="input-control space w-150px">
|
||||
<?php echo html::select('account', $users, $account, "onchange='changeUser(this.value, $projectID)' class='form-control chosen'");?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class='table table-fixed with-border'>
|
||||
<thead>
|
||||
<tr>
|
||||
<?php $vars = "projectID={$projectID}&type=$type¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<th class='w-150px'><?php common::printOrderLink('date', $orderBy, $vars, $lang->action->date);?></th>
|
||||
<th class='w-user'> <?php common::printOrderLink('actor', $orderBy, $vars, $lang->action->actor);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('action', $orderBy, $vars, $lang->action->action);?></th>
|
||||
<th class='w-80px'> <?php common::printOrderLink('objectType', $orderBy, $vars, $lang->action->objectType);?></th>
|
||||
<th class='w-id'> <?php common::printOrderLink('objectID', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th><?php echo $lang->action->objectName;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php if(count($actions)): ?>
|
||||
<tbody>
|
||||
<?php foreach($actions as $action):?>
|
||||
<?php $module = $action->objectType == 'case' ? 'testcase' : $action->objectType;?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $action->date;?></td>
|
||||
<td><?php isset($users[$action->actor]) ? print($users[$action->actor]) : print($action->actor);?></td>
|
||||
<td><?php echo $action->actionLabel;?></td>
|
||||
<td><?php echo $lang->action->objectTypes[$action->objectType];?></td>
|
||||
<td><?php echo $action->objectID;?></td>
|
||||
<td class='text-left'><?php echo html::a($action->objectLink, $action->objectName);?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<?php endif; ?>
|
||||
<tfoot><tr><td colspan='6'><?php $pager->show();?></td></tr></tfoot>
|
||||
</table>
|
||||
<script>$('#<?php echo $type;?>').addClass('active')</script>
|
||||
<div id="mainContent" class="main-content">
|
||||
<div id="dynamics">
|
||||
<?php $firstAction = '';?>
|
||||
<?php foreach($dateGroups as $date => $actions):?>
|
||||
<?php $isToday = date(DT_DATE4) == $date;?>
|
||||
<div class="dynamic <?php if($isToday) echo 'active';?>">
|
||||
<div class="dynamic-date">
|
||||
<?php if($isToday):?>
|
||||
<span class="date-label"><?php echo $lang->action->dynamic->today;?></span>
|
||||
<?php endif;?>
|
||||
<span class="date-text"><?php echo $date;?></span>
|
||||
<button type="button" class="btn btn-info btn-icon btn-sm dynamic-btn"><i class="icon icon-caret-up"></i></button>
|
||||
</div>
|
||||
<ul class="timeline timeline-tag-left">
|
||||
<?php if($direction == 'next') $actions = array_reverse($actions);?>
|
||||
<?php foreach($actions as $i => $action):?>
|
||||
<?php if(empty($firstAction)) $firstAction = $action;?>
|
||||
<li <?php if($action->actor == $this->app->user->account) echo "class='active'";?>>
|
||||
<div>
|
||||
<span class="timeline-tag"><?php echo $action->time?></span>
|
||||
<span class="timeline-text">
|
||||
<?php echo zget($users, $action->actor) . ' ' . $action->actionLabel;?>
|
||||
<span class="text-muted"><?php echo $action->objectLabel;?></span>
|
||||
<span class="label label-id"><?php echo $action->objectID;?></span>
|
||||
<?php echo html::a($action->objectLink, $action->objectName);?>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php if(!empty($firstAction)):?>
|
||||
<?php
|
||||
$firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600);
|
||||
$lastDate = substr($action->originalDate, 0, 10);
|
||||
$hasPre = $this->action->hasPreOrNext($firstDate, 'pre');
|
||||
$hasNext = $this->action->hasPreOrNext($lastDate, 'next');
|
||||
?>
|
||||
<?php if($hasPre or $hasNext):?>
|
||||
<div class='table-footer'>
|
||||
<ul class='pager'>
|
||||
<?php $class = $hasPre ? '' : 'disabled';?>
|
||||
<li class='<?php echo $class;?> pager-item-left'>
|
||||
<?php
|
||||
$link = '###';
|
||||
if($hasPre) $link = inlink('dynamic', "projectID=$projectID&type=$type¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre');
|
||||
echo html::a($link, '<i class="icon icon-angle-left"></i>', '', "class='pager-item'");
|
||||
?>
|
||||
</li>
|
||||
<?php $class = $hasNext ? '' : 'disabled';?>
|
||||
<li class='<?php echo $class;?> pager-item-left'>
|
||||
<?php
|
||||
$link = '###';
|
||||
if($hasNext) $link = inlink('dynamic', "projectID=$projectID&type=$type¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($lastDate) . '&direction=next');
|
||||
echo html::a($link, '<i class="icon icon-angle-right"></i>', '', "class='pager-item'");
|
||||
?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#dynamics').on('click', '.dynamic-btn', function()
|
||||
{
|
||||
$(this).closest('.dynamic').toggleClass('collapsed');
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.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'] = '156';
|
||||
$config->story->datatable->fieldList['actions']['width'] = '157';
|
||||
$config->story->datatable->fieldList['actions']['required'] = 'yes';
|
||||
|
||||
Reference in New Issue
Block a user