Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
+50
-3
@@ -560,10 +560,12 @@ 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);
|
||||
@@ -595,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()
|
||||
@@ -606,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);
|
||||
}
|
||||
|
||||
@@ -617,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) : '';
|
||||
|
||||
@@ -663,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);
|
||||
}
|
||||
@@ -981,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)
|
||||
@@ -995,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ include '../../common/view/chosen.html.php';
|
||||
|
||||
<div class="form-group form-actions">
|
||||
<div class="col-sm-7 col-sm-offset-3">
|
||||
<button type="submit" class="btn btn-wide btn-primary"><?php echo $lang->save;?></button>
|
||||
<button type="submit" class="btn btn-wide btn-primary"><?php echo $lang->save;?></button>
|
||||
<button type="cancel" class="btn btn-wide btn-gray" data-dismiss="modal"><?php echo $lang->cancel;?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -32,20 +32,20 @@ $useGuest = $this->app->user->account == 'guest';
|
||||
<?php endif;?>
|
||||
<nav class='panel-actions nav nav-default'>
|
||||
<?php if(!empty($block->moreLink)):?>
|
||||
<?php echo '<li>' . html::a($block->moreLink, 'MORE', '', "title='{$lang->more}'") . '</li>'; ?>
|
||||
<?php echo '<li>' . html::a($block->moreLink, 'MORE', '', "title='{$lang->more}'") . '</li>'; ?>
|
||||
<?php endif; ?>
|
||||
<li class='dropdown'>
|
||||
<a href='javascript:;' data-toggle='dropdown' class='panel-action'><i class='icon icon-ellipsis-v'></i></a>
|
||||
<ul class='dropdown-menu pull-right'>
|
||||
<?php if(!$useGuest):?>
|
||||
<li><a data-toggle='modal' href="<?php echo $this->createLink("block", "admin", "id=$block->id&module=$module"); ?>" class='edit-block' data-title='<?php echo $block->title; ?>' data-icon='icon-pencil'><i class='icon-pencil'></i> <?php echo $lang->edit;?></a></li>
|
||||
<li><a data-toggle='modal' href="<?php echo $this->createLink("block", "admin", "id=$block->id&module=$module");?>" class='edit-block' data-title='<?php echo $block->title;?>' ><?php echo $lang->edit;?></a></li>
|
||||
<?php if(!$block->source and $block->block == 'html'):?>
|
||||
<li><a href="javascript:hiddenBlock(<?php echo $index;?>)" class="hidden-panel"><i class='icon-eye-close'></i><?php echo $lang->block->hidden; ?></a></li>
|
||||
<li><a href="javascript:hiddenBlock(<?php echo $index;?>)" class="hidden-panel"><?php echo $lang->block->hidden;?></a></li>
|
||||
<?php endif;?>
|
||||
<li><a href='javascript:deleteBlock(<?php echo $index;?>);' class='remove-panel'><i class='icon-sm icon-close'></i> <?php echo $lang->block->remove;?></a></li>
|
||||
<li><a href='javascript:deleteBlock(<?php echo $index;?>);' class='remove-panel'><?php echo $lang->block->remove;?></a></li>
|
||||
<?php endif;?>
|
||||
<?php if($this->app->user->admin):?>
|
||||
<li><?php echo html::a($this->createLink('block', 'close', "blockID={$block->id}"), "<i class='icon-eye-close'></i> {$lang->block->closeForever}", 'hiddenwin', "class='close-block' onclick=\"return confirm('{$lang->block->confirmClose}')\"")?>
|
||||
<li><?php echo html::a($this->createLink('block', 'close', "blockID={$block->id}"), $lang->block->closeForever, 'hiddenwin', "class='close-block' onclick=\"return confirm('{$lang->block->confirmClose}')\"")?>
|
||||
<?php endif;?>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -78,14 +78,14 @@ $useGuest = $this->app->user->account == 'guest';
|
||||
<a href='javascript:;' data-toggle='dropdown' class='panel-action'><i class='icon icon-ellipsis-v'></i></a>
|
||||
<ul class='dropdown-menu pull-right'>
|
||||
<?php if(!$useGuest):?>
|
||||
<li><a data-toggle='modal' href="<?php echo $this->createLink("block", "admin", "id=$block->id&module=$module"); ?>" class='edit-block' data-title='<?php echo $block->title; ?>' data-icon='icon-pencil'><i class='icon-pencil'></i> <?php echo $lang->edit; ?></a></li>
|
||||
<li><a data-toggle='modal' href="<?php echo $this->createLink("block", "admin", "id=$block->id&module=$module"); ?>" class='edit-block' data-title='<?php echo $block->title; ?>' ><?php echo $lang->edit; ?></a></li>
|
||||
<?php if(!$block->source and $block->block == 'html'):?>
|
||||
<li><a href="javascript:hiddenBlock(<?php echo $index;?>)" class="hidden-panel"><i class='icon-eye-close'></i><?php echo $lang->block->hidden; ?></a></li>
|
||||
<li><a href="javascript:hiddenBlock(<?php echo $index;?>)" class="hidden-panel"><?php echo $lang->block->hidden; ?></a></li>
|
||||
<?php endif;?>
|
||||
<li><a href='javascript:deleteBlock(<?php echo $index?>);' class='remove-panel'><i class='icon-remove'></i> <?php echo $lang->block->remove; ?></a></li>
|
||||
<li><a href='javascript:deleteBlock(<?php echo $index?>);' class='remove-panel'><?php echo $lang->block->remove; ?></a></li>
|
||||
<?php endif;?>
|
||||
<?php if($this->app->user->admin):?>
|
||||
<li><?php echo html::a($this->createLink('block', 'close', "blockID={$block->id}"), "<i class='icon-eye-close'></i> {$lang->block->closeForever}", 'hiddenwin', "class='close-block' onclick=\"return confirm('{$lang->block->confirmClose}')\"")?>
|
||||
<li><?php echo html::a($this->createLink('block', 'close', "blockID={$block->id}"), $lang->block->closeForever, 'hiddenwin', "class='close-block' onclick=\"return confirm('{$lang->block->confirmClose}')\"")?>
|
||||
<?php endif;?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="todoDate" class="col-sm-2"><?php echo $lang->todo->date?></label>
|
||||
<div class="col-sm-9">
|
||||
<div class="col-sm-9 required">
|
||||
<div class="input-control has-icon-right">
|
||||
<input type="text" required class="form-control form-date" id="todoDate" name="date" placeholder="(<?php echo $lang->required;?>)">
|
||||
<label class="input-control-icon-right"><i class="icon icon-delay"></i></label>
|
||||
<input type="text" class="form-control form-date" id="todoDate" name="date" placeholder="(<?php echo $lang->required;?>)">
|
||||
<label for='todoDate' class="input-control-icon-right"><i class="icon icon-delay"></i></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -47,8 +47,9 @@
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-10">
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox"> <?php echo $lang->todo->private?></label>
|
||||
<div class="checkbox-primary">
|
||||
<input type="checkbox" name="private" id="private" value="1">
|
||||
<label for="private"><?php echo $lang->todo->private?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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';}
|
||||
|
||||
@@ -74,12 +74,10 @@ js::set('confirmDelete', $lang->user->confirmDelete);
|
||||
<tr>
|
||||
<td class='cell-id'>
|
||||
<?php if($canBatchEdit):?>
|
||||
<div class="checkbox-primary">
|
||||
<input type='checkbox' name='users[]' value='<?php echo $user->id;?>'/>
|
||||
<label></label>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php echo html::checkbox('users', array($user->account => sprintf('%03d', $user->id)));?>
|
||||
<?php else:?>
|
||||
<?php printf('%03d', $user->id);?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td><?php if(!common::printLink('user', 'view', "account=$user->account", $user->realname, '', "title='$user->realname'")) echo $user->realname;?></td>
|
||||
<td><?php echo $user->account;?></td>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -18,99 +18,91 @@
|
||||
<h2><i class='icon-pencil'></i> <?php echo $lang->my->editProfile;?></h2>
|
||||
</div>
|
||||
<form method='post' target='hiddenwin' id='dataform'>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->my->form->lblBasic;?></legend>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-90px'><?php echo $lang->user->realname;?></th>
|
||||
<td><?php echo html::input('realname', $user->realname, "class='form-control' autocomplete='off'");?></td>
|
||||
<th class='w-90px'><?php echo $lang->user->email;?></th>
|
||||
<td><?php echo html::input('email', $user->email, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->gender;?></th>
|
||||
<td><?php echo html::radio('gender', $lang->user->genderList, $user->gender);?></td>
|
||||
<th><?php echo $lang->user->birthyear;?></th>
|
||||
<td><?php echo html::input('birthday', $user->birthday,"class='form-date form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->join;?></th>
|
||||
<td class='text-middle'>
|
||||
<?php echo formatTime($user->join);?>
|
||||
<?php echo html::hidden('join',$user->join);?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->my->form->lblAccount;?></legend>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-90px'><?php echo $lang->user->account;?></th>
|
||||
<td style='width:33%'><?php echo html::input('account', $user->account, "class='form-control' readonly='readonly' autocomplete='off'");?></td>
|
||||
<th class='w-90px'><?php echo $lang->user->commiter;?></th>
|
||||
<td><?php echo html::input('commiter', $user->commiter, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->password;?></th>
|
||||
<td>
|
||||
<input type='password' style="display:none"> <!-- Disable input password by browser automatically. -->
|
||||
<span class='input-group'>
|
||||
<?php echo html::password('password1', '', "class='form-control disabled-ie-placeholder' autocomplete='off' onmouseup='checkPassword(this.value)' onkeyup='checkPassword(this.value)' placeholder='" . (!empty($config->safe->mode) ? $lang->user->placeholder->passwordStrength[$config->safe->mode] : '') . "'");?>
|
||||
<span class='input-group-addon' id='passwordStrength'></span>
|
||||
</span>
|
||||
<table class='table table-form'>
|
||||
<caption><?php echo $lang->my->form->lblBasic;?></caption>
|
||||
<tr>
|
||||
<th class='w-90px'><?php echo $lang->user->realname;?></th>
|
||||
<td><?php echo html::input('realname', $user->realname, "class='form-control' autocomplete='off'");?></td>
|
||||
<th class='w-90px'><?php echo $lang->user->email;?></th>
|
||||
<td><?php echo html::input('email', $user->email, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->gender;?></th>
|
||||
<td><?php echo html::radio('gender', $lang->user->genderList, $user->gender);?></td>
|
||||
<th><?php echo $lang->user->birthyear;?></th>
|
||||
<td><?php echo html::input('birthday', $user->birthday,"class='form-date form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->join;?></th>
|
||||
<td class='text-middle'>
|
||||
<?php echo formatTime($user->join);?>
|
||||
<?php echo html::hidden('join',$user->join);?>
|
||||
</td>
|
||||
<th><?php echo $lang->user->password2;?></th>
|
||||
<td><?php echo html::password('password2', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->my->form->lblContact;?></legend>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-90px'><?php echo $lang->user->skype;?></th>
|
||||
<td><?php echo html::input('skype', $user->skype, "class='form-control' autocomplete='off'");?></td>
|
||||
<th class='w-90px'><?php echo $lang->user->qq;?></th>
|
||||
<td><?php echo html::input('qq', $user->qq, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->yahoo;?></th>
|
||||
<td><?php echo html::input('yahoo', $user->yahoo, "class='form-control' autocomplete='off'");?></td>
|
||||
<th><?php echo $lang->user->gtalk;?></th>
|
||||
<td><?php echo html::input('gtalk', $user->gtalk, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->wangwang;?></th>
|
||||
<td><?php echo html::input('wangwang', $user->wangwang, "class='form-control' autocomplete='off'");?></td>
|
||||
<th><?php echo $lang->user->mobile;?></th>
|
||||
<td><?php echo html::input('mobile', $user->mobile, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->phone;?></th>
|
||||
<td><?php echo html::input('phone', $user->phone, "class='form-control' autocomplete='off'");?></td>
|
||||
<th><?php echo $lang->user->address;?></th>
|
||||
<td><?php echo html::input('address', $user->address, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->zipcode;?></th>
|
||||
<td><?php echo html::input('zipcode', $user->zipcode, "class='form-control' autocomplete='off'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->user->verify;?></legend>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-verifyPassword'><?php echo $lang->user->verifyPassword;?></th>
|
||||
<td>
|
||||
<div class="required required-wrapper"></div>
|
||||
<?php echo html::password('verifyPassword', '', "class='form-control disabled-ie-placeholder' placeholder='{$lang->user->placeholder->verify}'");?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</tr>
|
||||
</table>
|
||||
<table class='table table-form'>
|
||||
<caption><?php echo $lang->my->form->lblAccount;?></caption>
|
||||
<tr>
|
||||
<th class='w-90px'><?php echo $lang->user->account;?></th>
|
||||
<td style='width:33%'><?php echo html::input('account', $user->account, "class='form-control' readonly='readonly' autocomplete='off'");?></td>
|
||||
<th class='w-90px'><?php echo $lang->user->commiter;?></th>
|
||||
<td><?php echo html::input('commiter', $user->commiter, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->password;?></th>
|
||||
<td>
|
||||
<input type='password' style="display:none"> <!-- Disable input password by browser automatically. -->
|
||||
<span class='input-group'>
|
||||
<?php echo html::password('password1', '', "class='form-control disabled-ie-placeholder' autocomplete='off' onmouseup='checkPassword(this.value)' onkeyup='checkPassword(this.value)' placeholder='" . (!empty($config->safe->mode) ? $lang->user->placeholder->passwordStrength[$config->safe->mode] : '') . "'");?>
|
||||
<span class='input-group-addon' id='passwordStrength'></span>
|
||||
</span>
|
||||
</td>
|
||||
<th><?php echo $lang->user->password2;?></th>
|
||||
<td><?php echo html::password('password2', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class='table table-form'>
|
||||
<caption><?php echo $lang->my->form->lblContact;?></caption>
|
||||
<tr>
|
||||
<th class='w-90px'><?php echo $lang->user->skype;?></th>
|
||||
<td><?php echo html::input('skype', $user->skype, "class='form-control' autocomplete='off'");?></td>
|
||||
<th class='w-90px'><?php echo $lang->user->qq;?></th>
|
||||
<td><?php echo html::input('qq', $user->qq, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->yahoo;?></th>
|
||||
<td><?php echo html::input('yahoo', $user->yahoo, "class='form-control' autocomplete='off'");?></td>
|
||||
<th><?php echo $lang->user->gtalk;?></th>
|
||||
<td><?php echo html::input('gtalk', $user->gtalk, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->wangwang;?></th>
|
||||
<td><?php echo html::input('wangwang', $user->wangwang, "class='form-control' autocomplete='off'");?></td>
|
||||
<th><?php echo $lang->user->mobile;?></th>
|
||||
<td><?php echo html::input('mobile', $user->mobile, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->phone;?></th>
|
||||
<td><?php echo html::input('phone', $user->phone, "class='form-control' autocomplete='off'");?></td>
|
||||
<th><?php echo $lang->user->address;?></th>
|
||||
<td><?php echo html::input('address', $user->address, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->zipcode;?></th>
|
||||
<td><?php echo html::input('zipcode', $user->zipcode, "class='form-control' autocomplete='off'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class='table table-form'>
|
||||
<caption><?php echo $lang->user->verify;?></caption>
|
||||
<tr>
|
||||
<th class='w-verifyPassword'><?php echo $lang->user->verifyPassword;?></th>
|
||||
<td>
|
||||
<div class="required required-wrapper"></div>
|
||||
<?php echo html::password('verifyPassword', '', "class='form-control disabled-ie-placeholder' placeholder='{$lang->user->placeholder->verify}'");?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class='text-center'><?php echo html::submitButton() . ' ' . html::backButton();?></div>
|
||||
</form>
|
||||
<?php echo html::hidden('verifyRand', $rand);?>
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php if(common::hasPriv('todo', 'export')) echo html::a(helper::createLink('todo', 'export', "account=$account&orderBy=$orderBy", 'html', true), "<i class='icon-export muted'> </i> " . $lang->todo->export, '', "class='btn btn-link iframe'");?>
|
||||
<?php common::printIcon('todo', 'batchCreate', '', '', 'button', 'plus', '', 'btn-primary iframe', 'true', "id='batchCreate' data-width='80%'");?>
|
||||
<?php common::printLink('todo', 'batchCreate', '', "<i class='icon icon-plus'> </i>" . $lang->todo->batchCreate, '', "id='batchCreate' class='btn btn-secondary iframe' data-width='80%'", '', 'true');?>
|
||||
<?php common::printLink('todo', 'create', '', "<i class='icon icon-plus'> </i>" . $lang->todo->create, '', "id='create' class='btn btn-primary iframe' data-width='80%'", '', 'true');?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent">
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -91,12 +91,10 @@
|
||||
<tr data-id='<?php echo $product->id ?>' data-order='<?php echo $product->code;?>'>
|
||||
<td class='cell-id'>
|
||||
<?php if($canBatchEdit):?>
|
||||
<div class="checkbox-primary">
|
||||
<input type='checkbox' name='productIDList[<?php echo $product->id;?>]' value='<?php echo $product->id;?>' />
|
||||
<label></label>
|
||||
</div>
|
||||
<?php echo html::checkbox('productIDList', array($product->id => sprintf('%03d', $product->id)));?>
|
||||
<?php else:?>
|
||||
<?php printf('%03d', $product->id);?>
|
||||
<?php endif;?>
|
||||
<?php echo sprintf('%03d', $product->id);?>
|
||||
</td>
|
||||
<td title='<?php echo $product->name?>'><?php echo html::a($this->createLink('product', 'view', 'product=' . $product->id), $product->name);?></td>
|
||||
<td><?php echo zget($lines, $product->line);?></td>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -62,12 +62,10 @@
|
||||
<tr>
|
||||
<td class='cell-id'>
|
||||
<?php if(common::hasPriv('productplan', 'batchEdit')):?>
|
||||
<div class="checkbox-primary">
|
||||
<input type='checkbox' name='planIDList[<?php echo $plan->id;?>]' value='<?php echo $plan->id;?>' />
|
||||
<label></label>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php echo html::checkbox('planIDList', array($plan->id => sprintf('%03d', $plan->id)));?>
|
||||
<?php else:?>
|
||||
<?php echo sprintf('%03d', $plan->id);?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td class='text-left' title="<?php echo $plan->title?>"><?php echo html::a(inlink('view', "id=$plan->id"), $plan->title);?></td>
|
||||
<?php if($this->session->currentProductType != 'normal'):?>
|
||||
|
||||
+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';
|
||||
|
||||
@@ -2106,10 +2106,14 @@ class taskModel extends model
|
||||
switch($id)
|
||||
{
|
||||
case 'id':
|
||||
echo "<div class='checkbox-primary'>";
|
||||
if($mode == 'table' && $canBatchAction) echo "<input type='checkbox' name='taskIDList[{$task->id}]' value='{$task->id}'/><label></label>";
|
||||
echo sprintf('%03d', $task->id);
|
||||
echo '</div>';
|
||||
if($mode == 'table' && $canBatchAction)
|
||||
{
|
||||
echo html::checkbox('taskIDList', array($task->id => sprintf('%03d', $task->id)));
|
||||
}
|
||||
else
|
||||
{
|
||||
printf('%03d', $task->id);
|
||||
}
|
||||
break;
|
||||
case 'pri':
|
||||
echo "<span class='label-pri label-pri-" . $task->pri . "'>";
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
.todoType {margin-top: 6px;}
|
||||
.dateSwitcher {margin-top: 6px;}
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
#wrap .outer>table#actionbox>caption {margin-top:0px;}
|
||||
.table-data tbody > tr > th {width: 80px;}
|
||||
.modal-footer {text-align: center;}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<?php endif;?>
|
||||
<div class="row form-group">
|
||||
<label class="col-sm-2"><?php echo $lang->todo->type;?></label>
|
||||
<div class="col-sm-9">
|
||||
<div class="col-sm-9 todoType">
|
||||
<input type='hidden' name='type' value='<?php echo $todo->type;?>' />
|
||||
<?php echo $lang->todo->typeList[$todo->type];?>
|
||||
</div>
|
||||
@@ -109,7 +109,7 @@
|
||||
<div class="row form-group">
|
||||
<label class="col-sm-2"><?php echo $lang->todo->status;?></label>
|
||||
<div class="col-sm-2">
|
||||
<?php echo html::select('status', $lang->todo->statusList, $todo->status, "class='form-control chosen'");?>
|
||||
<?php echo html::select('status', $lang->todo->statusList, $todo->status, "class='form-control'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
@@ -121,15 +121,19 @@
|
||||
<?php echo html::select('end', $times, $todo->end, 'class="form-control chosen"');?>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type='checkbox' id='dateSwitcher' onclick='switchDateFeature(this);' <?php if($todo->begin == 2400) echo 'checked';?> >
|
||||
<label for='dateSwitcher'><?php echo $lang->todo->lblDisableDate;?></label>
|
||||
<div class='checkbox-primary dateSwitcher'>
|
||||
<input type='checkbox' id='dateSwitcher' onclick='switchDateFeature(this);' <?php if($todo->begin == 2400) echo 'checked';?> >
|
||||
<label for='dateSwitcher'><?php echo $lang->todo->lblDisableDate;?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<label class="col-sm-2"></label>
|
||||
<div class="col-sm-9">
|
||||
<input type='checkbox' name='private' id='private' value='1' <?php if($todo->private) echo 'checked';?> />
|
||||
<label for='private'><?php echo $lang->todo->private;?></label>
|
||||
<div class='checkbox-primary'>
|
||||
<input type='checkbox' name='private' id='private' value='1' <?php if($todo->private) echo 'checked';?> />
|
||||
<label for='private'><?php echo $lang->todo->private;?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group form-actions">
|
||||
|
||||
+104
-103
@@ -13,117 +13,118 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php if(!$todo->private or ($todo->private and $todo->account == $app->user->account)):?>
|
||||
<div class='container mw-700px'>
|
||||
<div id='titlebar'>
|
||||
<div class='heading'>
|
||||
<span class='prefix' title='TODO'><?php echo html::icon($lang->icons['todo']);?> <strong><?php echo $todo->id;?></strong></span>
|
||||
<strong><?php echo $todo->name;?></strong>
|
||||
</div>
|
||||
<div class='modal-content'>
|
||||
<div class="modal-header">
|
||||
<h4 class='modal-title pull-left'><?php echo html::a($this->createLink('todo', 'view', 'todo=' . $todo->id), "TODO #{$todo->id} {$todo->name}");?></h4>
|
||||
</div>
|
||||
<div class='row-table'>
|
||||
<div class='col-main'>
|
||||
<div class='main'>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<div class='main-row'>
|
||||
<div class='main-col col-8'>
|
||||
<div class='cell'>
|
||||
<div class='detail'>
|
||||
<div class='detail-title'>
|
||||
<?php
|
||||
echo $lang->todo->desc;
|
||||
if($todo->type == 'bug') echo html::a($this->createLink('bug', 'view', "id={$todo->idvalue}"), ' BUG#' . $todo->idvalue);
|
||||
if($todo->type == 'task') echo html::a($this->createLink('task', 'view', "id={$todo->idvalue}"), ' TASK#' . $todo->idvalue);
|
||||
if($todo->type == 'story') echo html::a($this->createLink('story', 'view', "id={$todo->idvalue}"), ' STORY#' . $todo->idvalue);
|
||||
?>
|
||||
</legend>
|
||||
<div><?php echo $todo->desc;?></div>
|
||||
</fieldset>
|
||||
<?php $actionTheme = 'fieldset'; include '../../common/view/action.html.php';?>
|
||||
</div>
|
||||
<div class='detail-content'><?php echo $todo->desc;?></div>
|
||||
</div>
|
||||
<div class='detail'><?php include '../../common/view/action.html.php';?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-side'>
|
||||
<div class='main main-side'>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->todo->legendBasic;?></legend>
|
||||
<table class='table table-data table-condensed table-borderless'>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->pri;?></th>
|
||||
<td><?php echo $lang->todo->priList[$todo->pri];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->status;?></th>
|
||||
<td class='todo-<?php echo $todo->status?>'><?php echo $lang->todo->statusList[$todo->status];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->type;?></th>
|
||||
<td><?php echo $lang->todo->typeList[$todo->type];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->todo->account;?></th>
|
||||
<td><?php echo zget($users, $todo->account);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->todo->date;?></th>
|
||||
<td><?php echo $todo->date == '20300101' ? $lang->todo->periods['future'] : date(DT_DATE1, strtotime($todo->date));?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->beginAndEnd;?></th>
|
||||
<td><?php if(isset($times[$todo->begin])) echo $times[$todo->begin]; if(isset($times[$todo->end])) echo ' ~ ' . $times[$todo->end];?></td>
|
||||
</tr>
|
||||
<?php if(isset($todo->assignedTo)):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->assignTo;?></th>
|
||||
<td><?php echo $todo->assignedTo;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->assignTo . $lang->todo->date;?></th>
|
||||
<td><?php echo $todo->assignedDate;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</table>
|
||||
</fieldset>
|
||||
<div class='side-col col-4'>
|
||||
<div class='cell'>
|
||||
<div class='detail'>
|
||||
<div class='detail-title'><?php echo $lang->todo->legendBasic;?></div>
|
||||
<div class='detail-content'>
|
||||
<table class='table table-data'>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->pri;?></th>
|
||||
<td><?php echo $lang->todo->priList[$todo->pri];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->status;?></th>
|
||||
<td class='todo-<?php echo $todo->status?>'><?php echo $lang->todo->statusList[$todo->status];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->type;?></th>
|
||||
<td><?php echo $lang->todo->typeList[$todo->type];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->account;?></th>
|
||||
<td><?php echo zget($users, $todo->account);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->date;?></th>
|
||||
<td><?php echo $todo->date == '20300101' ? $lang->todo->periods['future'] : formatTime($todo->date);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->beginAndEnd;?></th>
|
||||
<td><?php if(isset($times[$todo->begin])) echo $times[$todo->begin]; if(isset($times[$todo->end])) echo ' ~ ' . $times[$todo->end];?></td>
|
||||
</tr>
|
||||
<?php if(isset($todo->assignedTo)):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->assignTo;?></th>
|
||||
<td><?php echo $todo->assignedTo;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->todo->assignTo . $lang->todo->date;?></th>
|
||||
<td><?php echo formatTime($todo->assignedDate, DT_DATE1);?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($todo->cycle):?>
|
||||
<?php $todo->config = json_decode($todo->config);?>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->todo->cycle;?></legend>
|
||||
<table class='table table-data table-condensed table-borderless'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->todo->beginAndEnd?></th>
|
||||
<td><?php echo $todo->config->begin . " ~ " . $todo->config->end;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='w-80px text-top'><?php echo $lang->todo->cycleConfig?></th>
|
||||
<td>
|
||||
<?php
|
||||
if($todo->config->type == 'day')
|
||||
{
|
||||
echo $lang->todo->every . $todo->config->day . $lang->day;
|
||||
}
|
||||
elseif($todo->config->type == 'week')
|
||||
{
|
||||
foreach(explode(',', $todo->config->week) as $week) echo $lang->todo->dayNames[$week] . ' ';
|
||||
}
|
||||
elseif($todo->config->type == 'month')
|
||||
{
|
||||
foreach(explode(',', $todo->config->month) as $month) echo $month . ' ';
|
||||
}
|
||||
echo '<br />';
|
||||
if($todo->config->beforeDays) printf($lang->todo->lblBeforeDays, $todo->config->beforeDays);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<div class='detail'>
|
||||
<div class='detail-title'><?php echo $lang->todo->cycle;?></div>
|
||||
<div class='detail-content'>
|
||||
<table class='table table-data'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->todo->beginAndEnd?></th>
|
||||
<td><?php echo $todo->config->begin . " ~ " . $todo->config->end;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='w-80px text-top'><?php echo $lang->todo->cycleConfig?></th>
|
||||
<td>
|
||||
<?php
|
||||
if($todo->config->type == 'day')
|
||||
{
|
||||
echo $lang->todo->every . $todo->config->day . $lang->day;
|
||||
}
|
||||
elseif($todo->config->type == 'week')
|
||||
{
|
||||
foreach(explode(',', $todo->config->week) as $week) echo $lang->todo->dayNames[$week] . ' ';
|
||||
}
|
||||
elseif($todo->config->type == 'month')
|
||||
{
|
||||
foreach(explode(',', $todo->config->month) as $month) echo $month . ' ';
|
||||
}
|
||||
echo '<br />';
|
||||
if($todo->config->beforeDays) printf($lang->todo->lblBeforeDays, $todo->config->beforeDays);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='panel-footer text-center'>
|
||||
<div class='modal-footer'>
|
||||
<?php
|
||||
if($todo->account == $app->user->account)
|
||||
{
|
||||
if($todo->status != 'closed') echo html::a($this->createLink('todo', 'edit', "todoID=$todo->id"), "<i class='icon icon-edit'></i> " . $lang->todo->edit, '', "class='btn showinonlybody'");
|
||||
if($todo->status == 'done' || $todo->status == 'closed') echo html::a($this->createLink('todo', 'activate', "todoID=$todo->id"), "<i class='icon icon-magic'></i> " . $lang->todo->activate, 'hiddenwin', "class='btn showinonlybody'");
|
||||
if($todo->status == 'done') echo html::a($this->createLink('todo', 'close', "todoID=$todo->id"), "<i class='icon icon-off'></i> " . $lang->todo->close, 'hiddenwin', "class='btn showinonlybody'");
|
||||
echo html::a($this->createLink('todo', 'delete', "todoID=$todo->id"), "<i class='icon icon-remove'></i> " . $lang->todo->delete, 'hiddenwin', "class='btn showinonlybody'");
|
||||
if($todo->status != 'closed') echo html::a($this->createLink('todo', 'edit', "todoID=$todo->id"), "<i class='icon icon-edit'></i>", '', "title='{$lang->todo->edit}' class='btn showinonlybody'");
|
||||
if($todo->status == 'done' || $todo->status == 'closed') echo html::a($this->createLink('todo', 'activate', "todoID=$todo->id"), "<i class='icon icon-magic'></i>", 'hiddenwin', "title='{$lang->todo->activate}' class='btn showinonlybody'");
|
||||
if($todo->status == 'done') echo html::a($this->createLink('todo', 'close', "todoID=$todo->id"), "<i class='icon icon-off'></i>", 'hiddenwin', "title='{$lang->todo->close}' class='btn showinonlybody'");
|
||||
echo html::a($this->createLink('todo', 'delete', "todoID=$todo->id"), "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->todo->delete}' class='btn showinonlybody'");
|
||||
|
||||
echo html::a('#commentBox', '<i class="icon-comment-alt"></i>', '', "title='$lang->comment' onclick='setComment()' class='btn'");
|
||||
echo html::a('#commentBox', '<i class="icon-chat-line"></i>', '', "title='{$lang->comment}' onclick='setComment()' class='btn'");
|
||||
}
|
||||
|
||||
if($this->session->todoList)
|
||||
@@ -142,7 +143,7 @@
|
||||
if($todo->status != 'done' && $todo->status != 'closed')
|
||||
{
|
||||
echo "<div class='btn-group dropup'>";
|
||||
echo html::a($this->createLink('todo', 'finish', "id=$todo->id", 'html', true), "<i class='icon icon-ok'></i> " . $lang->todo->finish, 'hiddenwin', "class='btn showinonlybody btn-success'");
|
||||
echo html::a($this->createLink('todo', 'finish', "id=$todo->id", 'html', true), "<i class='icon icon-checked'></i>", 'hiddenwin', "title='{$lang->todo->finish}' class='btn showinonlybody btn-success'");
|
||||
$createStoryPriv = common::hasPriv('story', 'create');
|
||||
$createTaskPriv = common::hasPriv('task', 'create');
|
||||
$createBugPriv = common::hasPriv('bug', 'create');
|
||||
@@ -163,15 +164,15 @@
|
||||
|
||||
common::printRPN($browseLink);
|
||||
?>
|
||||
<div id='commentBox' class='hide'>
|
||||
<h4 class='text-left'><?php echo $lang->comment;?></h2>
|
||||
<form method='post' action='<?php echo $this->createLink('action', 'comment', "objectType=todo&objectID=$todo->id")?>' target='hiddenwin'>
|
||||
<div class="form-group"><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></div>
|
||||
<?php echo html::submitButton('', '', 'btn btn-wide btn-primary');?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset id='commentBox' class='hide'>
|
||||
<legend><?php echo $lang->comment;?></legend>
|
||||
<form method='post' action='<?php echo $this->createLink('action', 'comment', "objectType=todo&objectID=$todo->id")?>' target='hiddenwin'>
|
||||
<div class="form-group"><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></div>
|
||||
<?php echo html::submitButton();?>
|
||||
</form>
|
||||
</fieldset>
|
||||
<div class="modal fade" id="projectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
@@ -182,7 +183,7 @@
|
||||
<div class="modal-body">
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('project', $projects, '', "class='form-control chosen'");?>
|
||||
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['task'], "id='toTaskButton'");?></span>
|
||||
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['task'], "id='toTaskButton'", 'btn btn-primary');?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -198,8 +199,8 @@
|
||||
<div class="modal-body">
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('product', $products, '', "class='form-control chosen'");?>
|
||||
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['story'], "id='toStoryButton'");?></span>
|
||||
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['bug'], "id='toBugButton'");?></span>
|
||||
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['story'], "id='toStoryButton'", 'btn btn-primary');?></span>
|
||||
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['bug'], "id='toBugButton'", 'btn btn-primary');?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user