* change for print blok.

This commit is contained in:
wangyidong
2016-04-11 15:48:58 +08:00
parent 13f7011a05
commit 13f1fd6bf7
17 changed files with 321 additions and 67 deletions
+103 -20
View File
@@ -75,33 +75,32 @@ class block extends control
*
* @param int $index
* @param string $type
* @param int $blockID
* @access public
* @return void
*/
public function set($index, $type, $blockID = 0)
public function set($index, $type, $source = '')
{
if($_POST)
{
$source = isset($this->lang->block->moduleList[$type]) ? $type : '';
$this->block->save($index, $source, $this->session->blockModule, $blockID);
$source = isset($this->lang->block->moduleList[$source]) ? $source : '';
$this->block->save($index, $source, $type, $this->session->blockModule);
if(dao::isError()) die(js::error(dao::geterror()));
die(js::reload('parent'));
}
$block = $blockID ? $this->block->getByID($blockID) : $this->block->getBlock($index);
$block = $this->block->getBlock($index);
if($block) $type = $block->block;
if(isset($this->lang->block->moduleList[$type]))
if(isset($this->lang->block->moduleList[$source]))
{
$func = 'get' . ucfirst($blockID) . 'Params';
$params = $this->block->$func($type);
$func = 'get' . ucfirst($type) . 'Params';
$params = $this->block->$func($source);
$this->view->params = json_decode($params, true);
}
$this->view->type = $type;
$this->view->index = $index;
$this->view->blockID = $blockID;
$this->view->source = $source;
$this->view->type = $type;
$this->view->index = $index;
$this->view->block = ($block) ? $block : array();
$this->display();
}
@@ -231,7 +230,7 @@ class block extends control
$this->get->set('source', $block->source);
$this->get->set('blockid', $block->block);
$this->get->set('param',base64_encode(json_encode($block->params)));
$html = $this->fetch('block', 'main');
$html = $this->fetch('block', 'main', "module={$block->source}&index=$index");
}
elseif($block->block == 'dynamic')
{
@@ -306,6 +305,13 @@ class block extends control
$func = 'print' . ucfirst($code) . 'Block';
$this->$func($module);
$this->view->moreLink = '';
if(isset($this->lang->block->modules[$module]->moreLinkList->{$code}))
{
list($moduleName, $method, $vars) = explode('|', sprintf($this->lang->block->modules[$module]->moreLinkList->{$code}, $params->type));
$this->view->moreLink = $this->createLink($moduleName, $method, $vars);
}
if($this->viewType == 'json')
{
unset($this->view->app);
@@ -325,6 +331,20 @@ class block extends control
}
}
/**
* Print List block.
*
* @access public
* @return void
*/
public function printListBlock($module = 'product')
{
$func = 'print' . ucfirst($module) . 'Block';
$this->view->module = $module;
$this->$func();
}
/**
* Print todo block.
*
@@ -334,7 +354,6 @@ class block extends control
public function printTodoBlock()
{
$this->view->todos = $this->loadModel('todo')->getList('all', $this->app->user->account, 'wait, doing', $this->viewType == 'json' ? 0 : $this->params->num);
$this->view->listLink = $this->view->sso . $this->view->sign . 'referer=' . base64_encode($this->createLink('my', 'todo', "type=all"));
}
/**
@@ -346,7 +365,6 @@ class block extends control
public function printTaskBlock()
{
$this->view->tasks = $this->loadModel('task')->getUserTasks($this->app->user->account, $this->params->type, $this->viewType == 'json' ? 0 : $this->params->num, null, $this->params->orderBy);
$this->view->listLink = $this->view->sso . $this->view->sign . 'referer=' . base64_encode($this->createLink('my', 'task', "type={$this->params->type}"));
}
/**
@@ -358,7 +376,6 @@ class block extends control
public function printBugBlock()
{
$this->view->bugs = $this->loadModel('bug')->getUserBugs($this->app->user->account, $this->params->type, $this->params->orderBy, $this->viewType == 'json' ? 0 : $this->params->num);
$this->view->listLink = $this->view->sso . $this->view->sign . 'referer=' . base64_encode($this->createLink('my', 'bug', "type={$this->params->type}"));
}
/**
@@ -396,7 +413,26 @@ class block extends control
->fetchAll();
}
$this->view->cases = $cases;
$this->view->listLink = $this->view->sso . $this->view->sign . 'referer=' . base64_encode($this->createLink('my', 'testcase', "type={$this->params->type}"));
}
/**
* Print testtask block.
*
* @access public
* @return void
*/
public function printTesttaskBlock()
{
$this->app->loadLang('testtask');
$this->view->testtasks = $this->dao->select('t1.*,t2.name as productName,t3.name as buildName,t4.name as projectName')->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=t3.id')
->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.build=t4.id')
->where('t1.deleted')->eq('0')
->beginIF($this->params->type != 'all')->andWhere('t1.status')->eq($this->params->type)->fi()
->orderBy('t1.id desc')
->beginIF($this->viewType != 'json')->limit($this->params->num)->fi()
->fetchAll();
}
/**
@@ -410,9 +446,58 @@ class block extends control
$this->app->loadClass('pager', $static = true);
$pager = pager::init(0, $this->params->num, 1);
$this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $this->params->type, $this->params->orderBy, $this->viewType != 'json' ? $pager : '');
}
$listLink = $this->createLink('my', 'story', "type={$this->params->type}");
$this->view->listLink = !isset($this->view->sso) ? $listLink : $this->view->sso . $this->view->sign . 'referer=' . base64_encode($listLink);
/**
* Print plan block.
*
* @access public
* @return void
*/
public function printPlanBlock()
{
$this->app->loadLang('productplan');
$this->view->plans = $this->dao->select('t1.*,t2.name as productName')->from(TABLE_PRODUCTPLAN)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
->where('t1.deleted')->eq('0')
->orderBy('t1.begin desc')
->beginIF($this->viewType != 'json')->limit($this->params->num)->fi()
->fetchAll();
}
/**
* Print releases block.
*
* @access public
* @return void
*/
public function printReleaseBlock()
{
$this->app->loadLang('release');
$this->view->releases = $this->dao->select('t1.*,t2.name as productName,t3.name as buildName')->from(TABLE_RELEASE)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=t3.id')
->where('t1.deleted')->eq('0')
->orderBy('t1.id desc')
->beginIF($this->viewType != 'json')->limit($this->params->num)->fi()
->fetchAll();
}
/**
* Print Build block.
*
* @access public
* @return void
*/
public function printBuildBlock()
{
$this->app->loadLang('build');
$this->view->builds = $this->dao->select('t1.*,t2.productName')->from(TABLE_BUILD)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
->where('t1.deleted')->eq('0')
->orderBy('t1.id desc')
->beginIF($this->viewType != 'json')->limit($this->params->num)->fi()
->fetchAll();
}
/**
@@ -426,7 +511,6 @@ class block extends control
$this->app->loadClass('pager', $static = true);
$pager = pager::init(0, $this->params->num, 1);
$this->view->productStats = $this->loadModel('product')->getStats('order_desc', $this->viewType != 'json' ? $pager : '');
$this->view->listLink = $this->view->sso . $this->view->sign . 'referer=' . base64_encode($this->createLink('product', 'index', "locate=no&productID=" . current($this->view->productStats)->id));
}
/**
@@ -440,6 +524,5 @@ class block extends control
$this->app->loadClass('pager', $static = true);
$pager = pager::init(0, $this->params->num, 1);
$this->view->projectStats = $this->loadModel('project')->getProjectStats($status = 'undone', $productID = 0, $branch = 0, $itemCounts = 30, $orderBy = 'order_desc', $this->viewType != 'json' ? $pager : '');
$this->view->listLink = $this->view->sso . $this->view->sign . 'referer=' . base64_encode($this->createLink('my', 'project'));
}
}
+5 -9
View File
@@ -35,14 +35,12 @@ function getBlocks(moduleID)
* Get rss and html params.
*
* @param string $type
* @param int $blockID
* @access public
* @return void
*/
function getRssAndHtmlParams(type, blockID)
function getRssAndHtmlParams(type)
{
blockID = typeof(blockID) == 'undefined' ? 0 : blockID;
$.get(createLink('block', 'set', 'index=' + index + '&type=' + type + '&blockID=' + blockID), function(data)
$.get(createLink('block', 'set', 'index=' + index + '&type=' + type), function(data)
{
$('#blockParam').html(data);
});
@@ -51,17 +49,15 @@ function getRssAndHtmlParams(type, blockID)
/**
* Get block params.
*
* @param string $blockID
* @param string $type
* @param int $moduleID
* @access public
* @return void
*/
function getBlockParams(blockID, moduleID)
function getBlockParams(type, moduleID)
{
$('#blockParam').empty();
if(blockID == '') return false;
$.get(createLink('block', 'set', 'index=' + index + '&type=' + moduleID + '&blockID=' + blockID), function(data)
$.get(createLink('block', 'set', 'index=' + index + '&type=' + type + '&source=' + moduleID), function(data)
{
$('#blockParam').html(data);
});
+2 -2
View File
@@ -21,16 +21,16 @@ class blockModel extends model
* @access public
* @return void
*/
public function save($index, $source, $module = 'my', $blockID = 0)
public function save($index, $source, $type, $module = 'my')
{
$data = fixer::input('post')
->add('account', $this->app->user->account)
->add('order', $index)
->add('module', $module)
->add('hidden', 0)
->setIF($blockID, 'id', $blockID)
->setDefault('grid', '4')
->setDefault('source', $source)
->setDefault('block', $type)
->setDefault('params', array())
->get();
+6 -5
View File
@@ -20,8 +20,11 @@
</tr>
</thead>
<?php foreach($bugs as $bug):?>
<?php $appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : ''?>
<tr data-url='<?php echo $sso . $sign . 'referer=' . base64_encode($this->createLink('bug', 'view', "bugID={$bug->id}")); ?>' <?php echo $appid?>>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('bug', 'view', "bugID={$bug->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td><?php echo $bug->id;?></td>
<td><?php echo zget($lang->bug->severityList, $bug->severity, $bug->severity)?></td>
<td><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?></td>
@@ -29,8 +32,6 @@
</tr>
<?php endforeach;?>
</table>
<p class='hide block-bug-link'><?php echo $listLink;?></p>
<script>
$('.block-bug').dataTable();
$('.block-bug-link').closest('.panel').find('.panel-heading .more').attr('href', $('.block-bug-link').html());
if(typeof(dataTable) == 'function')$('.block-bug').dataTable();
</script>
+37
View File
@@ -0,0 +1,37 @@
<?php
/**
* The build block view file of block module of RanZhi.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package block
* @version $Id$
* @link http://www.ranzhi.org
*/
?>
<table class='table table-data table-hover block-build table-fixed'>
<thead>
<tr>
<th width='50'><?php echo $lang->idAB?></th>
<th> <?php echo $lang->build->product;?></th>
<th> <?php echo $lang->build->name;?></th>
<th width='80'><?php echo $lang->build->date;?></th>
</tr>
</thead>
<?php foreach($builds as $build):?>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('build', 'view', "buildID={$build->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='text-center'><?php echo $build->id;?></td>
<td title='<?php echo $build->productName?>'><?php echo $build->productName?></td>
<td title='<?php echo $build->name?>'><?php echo $build->name?></td>
<td><?php echo $build->date?></td>
</tr>
<?php endforeach;?>
</table>
<script>
if(typeof(dataTable) == 'function')$('.block-build').dataTable();
</script>
+6 -5
View File
@@ -22,8 +22,11 @@
</tr>
</thead>
<?php foreach($cases as $case):?>
<?php $appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : ''?>
<tr data-url='<?php echo $sso . $sign . 'referer=' . base64_encode($this->createLink('testcase', 'view', "caseID={$case->id}")); ?>' <?php echo $appid?>>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('testcase', 'view', "caseID={$case->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td><?php echo $case->id;?></td>
<td><?php echo zget($lang->case->priList, $case->pri, $case->pri)?></td>
<td title='<?php echo $case->title?>'><?php echo $case->title?></td>
@@ -33,8 +36,6 @@
</tr>
<?php endforeach;?>
</table>
<p class='hide block-case-link'><?php echo $listLink;?></p>
<script>
$('.block-case').dataTable();
$('.block-case-link').closest('.panel').find('.panel-heading .more').attr('href', $('.block-case-link').html());
if(typeof(dataTable) == 'function')$('.block-case').dataTable();
</script>
+13
View File
@@ -0,0 +1,13 @@
<?php
/**
* The list block view file of block module of RanZhi.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package block
* @version $Id$
* @link http://www.ranzhi.org
*/
?>
<?php include "./{$module}block.html.php";?>
+39
View File
@@ -0,0 +1,39 @@
<?php
/**
* The plan block view file of block module of RanZhi.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package block
* @version $Id$
* @link http://www.ranzhi.org
*/
?>
<table class='table table-data table-hover block-plan table-fixed'>
<thead>
<tr>
<th width='50'><?php echo $lang->idAB?></th>
<th> <?php echo $lang->productplan->product;?></th>
<th> <?php echo $lang->productplan->title;?></th>
<th width='80'><?php echo $lang->productplan->begin;?></th>
<th width='80'><?php echo $lang->productplan->end;?></th>
</tr>
</thead>
<?php foreach($plans as $plan):?>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('productplan', 'view', "planID={$plan->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='text-center'><?php echo $plan->id;?></td>
<td title='<?php echo $plan->productName?>'><?php echo $plan->productName?></td>
<td title='<?php echo $plan->title?>'><?php echo $plan->title?></td>
<td><?php echo $plan->begin?></td>
<td><?php echo $plan->end?></td>
</tr>
<?php endforeach;?>
</table>
<script>
if(typeof(dataTable) == 'function')$('.block-plan').dataTable();
</script>
+6 -5
View File
@@ -25,8 +25,11 @@
</thead>
<tbody>
<?php foreach($productStats as $product):?>
<?php $appid = isset($_GET['entry']) ? "class='app-btn text-center' data-id='{$this->get->entry}'" : "class='text-center'"?>
<tr data-url='<?php echo $sso . $sign . 'referer=' . base64_encode($this->createLink('product', 'browse', 'productID=' . $product->id)); ?>' <?php echo $appid?>>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn text-center' data-id='{$this->get->entry}'" : "class='text-center'";
$viewLink = $this->createLink('product', 'browse', 'productID=' . $product->id);
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='text-left' title='<?php echo $product->name?>'><?php echo $product->name?></td>
<td><?php echo $product->stories['active']?></td>
<td><?php echo $product->stories['changed']?></td>
@@ -39,8 +42,6 @@
<?php endforeach;?>
</tbody>
</table>
<p class='hide block-product-link'><?php echo $listLink;?></p>
<script>
$('.block-product').dataTable();
$('.block-product-link').closest('.panel').find('.panel-heading .more').attr('href', $('.block-product-link').html());
if(typeof(dataTable) == 'function')$('.block-product').dataTable();
</script>
+6 -5
View File
@@ -25,8 +25,11 @@
<tbody>
<?php $id = 0; ?>
<?php foreach($projectStats as $project):?>
<?php $appid = isset($_GET['entry']) ? "class='app-btn text-center' data-id='{$this->get->entry}'" : "class='text-center'"?>
<tr data-url='<?php echo $sso . $sign . 'referer=' . base64_encode($this->createLink('project', 'task', 'project=' . $project->id)); ?>' <?php echo $appid?>>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn text-center' data-id='{$this->get->entry}'" : "class='text-center'";
$viewLink = $this->createLink('project', 'task', 'project=' . $project->id);
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='text-left' title='<?php echo $project->name;?>'><?php echo $project->name;?></td>
<td><?php echo $project->end;?></td>
<?php if(isset($project->delay)):?>
@@ -42,8 +45,6 @@
<?php endforeach;?>
</tbody>
</table>
<p class='hide block-project-link'><?php echo $listLink;?></p>
<script>
$('.block-project').dataTable();
$('.block-project-link').closest('.panel').find('.panel-heading .more').attr('href', $('.block-project-link').html());
if(typeof(dataTable) == 'function')$('.block-project').dataTable();
</script>
+41
View File
@@ -0,0 +1,41 @@
<?php
/**
* The release block view file of block module of RanZhi.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package block
* @version $Id$
* @link http://www.ranzhi.org
*/
?>
<table class='table table-data table-hover block-release table-fixed'>
<thead>
<tr>
<th width='50'><?php echo $lang->idAB?></th>
<th> <?php echo $lang->release->product;?></th>
<th> <?php echo $lang->release->name;?></th>
<th> <?php echo $lang->release->build;?></th>
<th width='80'><?php echo $lang->release->date;?></th>
<th width='80'><?php echo $lang->release->status;?></th>
</tr>
</thead>
<?php foreach($releases as $release):?>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('release', 'view', "releaseID={$release->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='text-center'><?php echo $release->id;?></td>
<td title='<?php echo $release->productName?>'><?php echo $release->productName?></td>
<td title='<?php echo $release->name?>'><?php echo $release->name?></td>
<td title='<?php echo $release->buildName?>'><?php echo $release->buildName?></td>
<td><?php echo $release->date?></td>
<td><?php echo $lang->release->statusList[$release->status]?></td>
</tr>
<?php endforeach;?>
</table>
<script>
if(typeof(dataTable) == 'function')$('.block-release').dataTable();
</script>
+2 -2
View File
@@ -11,7 +11,7 @@
*/
?>
<?php
if(isset($lang->block->moduleList[$type]))
if(isset($lang->block->moduleList[$source]))
{
include 'setmodule.html.php';
die();
@@ -24,7 +24,7 @@ if($type == 'html')
include '../../common/view/kindeditor.html.php';
}
?>
<form method='post' id='blockForm' target='hiddenwin' class='form form-horizontal' action='<?php echo $this->createLink('block', 'set', "index=$index&type=$type&blockID=$blockID")?>'>
<form method='post' id='blockForm' target='hiddenwin' class='form form-horizontal' action='<?php echo $this->createLink('block', 'set', "index=$index&type=$type&source=$source")?>'>
<table class='table table-form'>
<tbody>
<?php include 'publicform.html.php';?>
+1 -1
View File
@@ -16,7 +16,7 @@ $jsRoot = $webRoot . "js/";
$themeRoot = $webRoot . "theme/";
include "../../common/view/chosen.html.php";
?>
<form method='post' id='blockForm' target='hiddenwin' class='form form-horizontal' action='<?php echo $this->createLink('block', 'set', "index=$index&type=$type")?>'>
<form method='post' id='blockForm' target='hiddenwin' class='form form-horizontal' action='<?php echo $this->createLink('block', 'set', "index=$index&type=$type&source=$source")?>'>
<table class='table table-form'>
<tbody>
<?php include './publicform.html.php'?>
+1 -3
View File
@@ -36,8 +36,6 @@
</tr>
<?php endforeach;?>
</table>
<p class='hide block-story-link'><?php echo $listLink;?></p>
<script>
$('.block-story').dataTable();
$('.block-story-link').closest('.panel').find('.panel-heading .more').attr('href', $('.block-story-link').html());
if(typeof(dataTable) == 'function')$('.block-story').dataTable();
</script>
+6 -5
View File
@@ -25,8 +25,11 @@ td.delayed{background: #e84e0f!important; color: white;}
</tr>
</thead>
<?php foreach($tasks as $task):?>
<?php $appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : ''?>
<tr data-url='<?php echo $sso . $sign . 'referer=' . base64_encode($this->createLink('task', 'view', "taskID={$task->id}")); ?>' <?php echo $appid?>>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('task', 'view', "taskID={$task->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td><?php echo $task->id;?></td>
<td><?php echo zget($lang->task->priList, $task->pri, $task->pri)?></td>
<td title='<?php echo $task->name?>'><?php echo $task->name?></td>
@@ -36,8 +39,6 @@ td.delayed{background: #e84e0f!important; color: white;}
</tr>
<?php endforeach;?>
</table>
<p class='hide block-task-link'><?php echo $listLink;?></p>
<script>
$('.block-task').dataTable();
$('.block-task-link').closest('.panel').find('.panel-heading .more').attr('href', $('.block-task-link').html());
if(typeof(dataTable) == 'function')$('.block-task').dataTable();
</script>
+41
View File
@@ -0,0 +1,41 @@
<?php
/**
* The testtask block view file of block module of RanZhi.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package block
* @version $Id$
* @link http://www.ranzhi.org
*/
?>
<table class='table table-data table-hover block-testtask table-fixed'>
<thead>
<tr>
<th width='50'><?php echo $lang->idAB?></th>
<th> <?php echo $lang->testtask->product;?></th>
<th> <?php echo $lang->testtask->name;?></th>
<th> <?php echo $lang->testtask->project . '/' . $lang->testtask->project;?></th>
<th width='80'><?php echo $lang->testtask->begin;?></th>
<th width='80'><?php echo $lang->testtask->end;?></th>
</tr>
</thead>
<?php foreach($testtasks as $testtask):?>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('testtask', 'view', "testtaskID={$testtask->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='text-center'><?php echo $testtask->id;?></td>
<td title='<?php echo $testtask->productName?>'><?php echo $testtask->productName?></td>
<td title='<?php echo $testtask->name?>'><?php echo $testtask->name?></td>
<td title='<?php echo $testtask->projectName . '/' . $testtask->buildName?>'><?php echo $testtask->projectName . '/' . $testtask->buildName?></td>
<td><?php echo $testtask->begin?></td>
<td><?php echo $testtask->end?></td>
</tr>
<?php endforeach;?>
</table>
<script>
if(typeof(dataTable) == 'function')$('.block-testtask').dataTable();
</script>
+6 -5
View File
@@ -21,8 +21,11 @@
</tr>
</thead>
<?php foreach($todos as $id => $todo):?>
<?php $appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : ''?>
<tr data-url='<?php echo $sso . $sign . 'referer=' . base64_encode($this->createLink('todo', 'view', "todoID={$todo->id}")); ?>' <?php echo $appid?>>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('todo', 'view', "todoID={$todo->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td><?php echo $todo->date == '2030-01-01' ? $lang->todo->periods['future'] : $todo->date;?></td>
<td><?php echo zget($lang->todo->priList, $todo->pri, $todo->pri)?></td>
<td><?php echo $todo->name?></td>
@@ -31,8 +34,6 @@
</tr>
<?php endforeach;?>
</table>
<p class='hide block-todo-link'><?php echo $listLink;?></p>
<script>
$('.block-todo').dataTable();
$('.block-todo-link').closest('.panel').find('.panel-heading .more').attr('href', $('.block-todo-link').html());
if(typeof(dataTable) == 'function')$('.block-todo').dataTable();
</script>