add childTask and multiTask

This commit is contained in:
滔哥
2017-10-20 14:08:01 +08:00
76 changed files with 1809 additions and 665 deletions
+5 -5
View File
@@ -20,7 +20,7 @@
5. 灵活的扩展机制,可以保证您不局限于禅道自身的功能。
6. 日趋完善的社区机制,可以获得及时的技术支持和帮助,保证您无后顾之忧。
7. 几乎为零的投入,禅道作为开源软件,其投入几乎为零,相比动辄十几万的商业软件,您选择禅道没有任何风险。
8. 开发团队已经公司化运作,保证软件的持久发展。我们从04年从事开源软件开发以来,已经坚持了六年。
8. 开发团队已经公司化运作,保证软件的持久发展。我们从04年从事开源软件开发以来,已经坚持了六年。
五、禅道的功能列表:
@@ -29,10 +29,10 @@
3. 质量管理:包括bug、测试用例、测试任务、测试结果等功能。
4. 文档管理:包括产品文档库、项目文档库、自定义文档库等功能。
5. 事务管理:包括todo管理,我的任务、我的Bug、我的需求、我的项目等个人事务管理功能。
6. 组织管理:包括部门、用户、分组、权限等功能。
7. 统计功能:丰富的统计表。
8. 搜索功能:强大的搜索,帮助您找到相应的数据。
9. 灵活的扩展机制,几乎可以对禅道的任何地方进行扩展。
6. 组织管理:包括部门、用户、分组、权限等功能。
7. 统计功能:丰富的统计表。
8. 搜索功能:强大的搜索,帮助您找到相应的数据。
9. 灵活的扩展机制,几乎可以对禅道的任何地方进行扩展。
10. 强大的api机制,方便与其他系统集成。
+3
View File
@@ -101,6 +101,9 @@ define('TABLE_DOCCONTENT', '`' . $config->db->prefix . 'doccontent`');
define('TABLE_TESTSUITE', '`' . $config->db->prefix . 'testsuite`');
define('TABLE_SUITECASE', '`' . $config->db->prefix . 'suitecase`');
define('TABLE_TESTREPORT', '`' . $config->db->prefix . 'testreport`');
define('TABLE_ENTRY', '`' . $config->db->prefix . 'entry`');
define('TABLE_WEBHOOK', '`' . $config->db->prefix . 'webhook`');
if(!defined('TABLE_LANG')) define('TABLE_LANG', '`' . $config->db->prefix . 'lang`');
$config->objectTables['product'] = TABLE_PRODUCT;
+29
View File
@@ -0,0 +1,29 @@
-- DROP TABLE IF EXISTS `zt_entry`;
CREATE TABLE IF NOT EXISTS `zt_entry` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`code` varchar(20) NOT NULL,
`key` varchar(32) NOT NULL,
`ip` varchar(100) NOT NULL,
`desc` text NOT NULL,
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
`editedBy` varchar(30) NOT NULL,
`editedDate` datetime NOT NULL,
PRIMARY KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_webhook`;
CREATE TABLE IF NOT EXISTS `zt_webhook` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`url` varchar(255) NOT NULL,
`requestType` enum('post', 'get') NOT NULL DEFAULT 'get',
`params` text NOT NULL,
`desc` text NOT NULL,
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
`editedBy` varchar(30) NOT NULL,
`editedDate` datetime NOT NULL,
PRIMARY KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+1 -1
View File
@@ -53,7 +53,7 @@ class actionModel extends model
/* Get product and project for this object. */
$productAndProject = $this->getProductAndProject($action->objectType, $objectID);
$action->product = $productAndProject['product'];
$action->project = $productAndProject['project'];
$action->project = (int)$productAndProject['project'];
$this->dao->insert(TABLE_ACTION)->data($action)->autoCheck()->exec();
$actionID = $this->dbh->lastInsertID();
+57 -7
View File
@@ -165,7 +165,7 @@ $config->bug->search['params']['lastEditedDate']= array('operator' => '=',
$config->bug->search['params']['deadline'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->bug->datatable = new stdclass();
$config->bug->datatable->defaultField = array('id', 'severity', 'pri', 'title', 'status', 'openedBy', 'openedDate', 'assignedTo', 'resolvedBy', 'resolution', 'resolvedDate', 'actions');
$config->bug->datatable->defaultField = array('id', 'severity', 'pri', 'title', 'status', 'openedBy', 'openedDate', 'assignedTo', 'resolvedBy', 'resolution', 'actions');
$config->bug->datatable->fieldList['id']['title'] = 'idAB';
$config->bug->datatable->fieldList['id']['fixed'] = 'left';
@@ -174,7 +174,7 @@ $config->bug->datatable->fieldList['id']['required'] = 'yes';
$config->bug->datatable->fieldList['severity']['title'] = 'severityAB';
$config->bug->datatable->fieldList['severity']['fixed'] = 'left';
$config->bug->datatable->fieldList['severity']['width'] = '50';
$config->bug->datatable->fieldList['severity']['width'] = '40';
$config->bug->datatable->fieldList['severity']['required'] = 'no';
$config->bug->datatable->fieldList['pri']['title'] = 'P';
@@ -187,11 +187,26 @@ $config->bug->datatable->fieldList['title']['fixed'] = 'left';
$config->bug->datatable->fieldList['title']['width'] = 'auto';
$config->bug->datatable->fieldList['title']['required'] = 'yes';
$config->bug->datatable->fieldList['branch']['title'] = 'branch';
$config->bug->datatable->fieldList['branch']['fixed'] = 'left';
$config->bug->datatable->fieldList['branch']['width'] = '100';
$config->bug->datatable->fieldList['branch']['required'] = 'no';
$config->bug->datatable->fieldList['type']['title'] = 'type';
$config->bug->datatable->fieldList['type']['fixed'] = 'no';
$config->bug->datatable->fieldList['type']['width'] = '90';
$config->bug->datatable->fieldList['type']['required'] = 'no';
$config->bug->datatable->fieldList['project']['title'] = 'project';
$config->bug->datatable->fieldList['project']['fixed'] = 'no';
$config->bug->datatable->fieldList['project']['width'] = '120';
$config->bug->datatable->fieldList['project']['required'] = 'no';
$config->bug->datatable->fieldList['plan']['title'] = 'plan';
$config->bug->datatable->fieldList['plan']['fixed'] = 'no';
$config->bug->datatable->fieldList['plan']['width'] = '120';
$config->bug->datatable->fieldList['plan']['required'] = 'no';
$config->bug->datatable->fieldList['status']['title'] = 'statusAB';
$config->bug->datatable->fieldList['status']['fixed'] = 'no';
$config->bug->datatable->fieldList['status']['width'] = '80';
@@ -207,6 +222,41 @@ $config->bug->datatable->fieldList['activatedDate']['fixed'] = 'no';
$config->bug->datatable->fieldList['activatedDate']['width'] = '90';
$config->bug->datatable->fieldList['activatedDate']['required'] = 'no';
$config->bug->datatable->fieldList['story']['title'] = 'story';
$config->bug->datatable->fieldList['story']['fixed'] = 'no';
$config->bug->datatable->fieldList['story']['width'] = '120';
$config->bug->datatable->fieldList['story']['required'] = 'no';
$config->bug->datatable->fieldList['task']['title'] = 'task';
$config->bug->datatable->fieldList['task']['fixed'] = 'no';
$config->bug->datatable->fieldList['task']['width'] = '120';
$config->bug->datatable->fieldList['task']['required'] = 'no';
$config->bug->datatable->fieldList['keywords']['title'] = 'keywords';
$config->bug->datatable->fieldList['keywords']['fixed'] = 'no';
$config->bug->datatable->fieldList['keywords']['width'] = '100';
$config->bug->datatable->fieldList['keywords']['required'] = 'no';
$config->bug->datatable->fieldList['os']['title'] = 'os';
$config->bug->datatable->fieldList['os']['fixed'] = 'no';
$config->bug->datatable->fieldList['os']['width'] = '80';
$config->bug->datatable->fieldList['os']['required'] = 'no';
$config->bug->datatable->fieldList['browser']['title'] = 'browser';
$config->bug->datatable->fieldList['browser']['fixed'] = 'no';
$config->bug->datatable->fieldList['browser']['width'] = '80';
$config->bug->datatable->fieldList['browser']['required'] = 'no';
$config->bug->datatable->fieldList['found']['title'] = 'found';
$config->bug->datatable->fieldList['found']['fixed'] = 'no';
$config->bug->datatable->fieldList['found']['width'] = '80';
$config->bug->datatable->fieldList['found']['required'] = 'no';
$config->bug->datatable->fieldList['mailto']['title'] = 'mailto';
$config->bug->datatable->fieldList['mailto']['fixed'] = 'no';
$config->bug->datatable->fieldList['mailto']['width'] = '100';
$config->bug->datatable->fieldList['mailto']['required'] = 'no';
$config->bug->datatable->fieldList['openedBy']['title'] = 'openedByAB';
$config->bug->datatable->fieldList['openedBy']['fixed'] = 'no';
$config->bug->datatable->fieldList['openedBy']['width'] = '80';
@@ -267,6 +317,11 @@ $config->bug->datatable->fieldList['closedDate']['fixed'] = 'no';
$config->bug->datatable->fieldList['closedDate']['width'] = '90';
$config->bug->datatable->fieldList['closedDate']['required'] = 'no';
$config->bug->datatable->fieldList['lastEditedBy']['title'] = 'lastEditedBy';
$config->bug->datatable->fieldList['lastEditedBy']['fixed'] = 'no';
$config->bug->datatable->fieldList['lastEditedBy']['width'] = '80';
$config->bug->datatable->fieldList['lastEditedBy']['required'] = 'no';
$config->bug->datatable->fieldList['lastEditedDate']['title'] = 'lastEditedDateAB';
$config->bug->datatable->fieldList['lastEditedDate']['fixed'] = 'no';
$config->bug->datatable->fieldList['lastEditedDate']['width'] = '90';
@@ -276,8 +331,3 @@ $config->bug->datatable->fieldList['actions']['title'] = 'actions';
$config->bug->datatable->fieldList['actions']['fixed'] = 'right';
$config->bug->datatable->fieldList['actions']['width'] = '140';
$config->bug->datatable->fieldList['actions']['required'] = 'yes';
$config->bug->datatable->fieldList['branch']['title'] = 'branch';
$config->bug->datatable->fieldList['branch']['fixed'] = 'left';
$config->bug->datatable->fieldList['branch']['width'] = '100';
$config->bug->datatable->fieldList['branch']['required'] = 'no';
+14
View File
@@ -121,6 +121,16 @@ class bug extends control
/* Process the openedBuild and resolvedBuild fields. */
$bugs = $this->bug->processBuildForBugs($bugs);
/* Get story and task id list. */
$storyIdList = $taskIdList = array();
foreach($bugs as $bug)
{
if($bug->story) $storyIdList[$bug->story] = $bug->story;
if($bug->task) $taskIdList[$bug->task] = $bug->task;
}
$storyList = $storyIdList ? $this->loadModel('story')->getByList($storyIdList) : array();
$taskList = $taskIdList ? $this->loadModel('task')->getByList($taskIdList) : array();
/* Build the search form. */
$actionURL = $this->createLink('bug', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
$this->config->bug->search['onMenuBar'] = 'yes';
@@ -150,6 +160,10 @@ class bug extends control
$this->view->memberPairs = $this->user->getPairs('noletter|nodeleted');
$this->view->branch = $branch;
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
$this->view->projects = $projects;
$this->view->plans = $this->loadModel('productplan')->getPairs($productID);
$this->view->stories = $storyList;
$this->view->tasks = $taskList;
$this->view->setShowModule = true;
$this->display();
+1
View File
@@ -51,6 +51,7 @@ $lang->bug->resolvedBuild = 'Resolved Build';
$lang->bug->resolvedDate = 'Resolved On';
$lang->bug->resolvedDateAB = 'Resolved On';
$lang->bug->deadline = 'Deadline';
$lang->bug->plan = 'Plan';
$lang->bug->closedBy = 'Closed By';
$lang->bug->closedDate = 'Closed On';
$lang->bug->duplicateBug = 'Duplicate';
+1
View File
@@ -51,6 +51,7 @@ $lang->bug->resolvedBuild = '解决版本';
$lang->bug->resolvedDate = '解决日期';
$lang->bug->resolvedDateAB = '解决日期';
$lang->bug->deadline = '截止日期';
$lang->bug->plan = '所属计划';
$lang->bug->closedBy = '由谁关闭';
$lang->bug->closedDate = '关闭日期';
$lang->bug->duplicateBug = '重复ID';
+40 -4
View File
@@ -2310,7 +2310,7 @@ class bugModel extends model
* @access public
* @return void
*/
public function printCell($col, $bug, $users, $builds, $branches, $modulePairs)
public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array())
{
$bugLink = inlink('view', "bugID=$bug->id");
$account = $this->app->user->account;
@@ -2349,6 +2349,18 @@ class bugModel extends model
case 'branch':
echo $branches[$bug->branch];
break;
case 'project':
echo zget($projects, $bug->project, '');
break;
case 'plan':
echo zget($plans, $bug->plan, '');
break;
case 'story':
echo zget($stories, $bug->story, '');
break;
case 'task':
echo zget($tasks, $bug->task, '');
break;
case 'type':
echo zget($this->lang->bug->typeList, $bug->type);
break;
@@ -2361,6 +2373,27 @@ class bugModel extends model
case 'activatedDate':
echo substr($bug->activatedDate, 5, 11);
break;
case 'keywords':
echo $bug->keywords;
break;
case 'os':
echo zget($this->lang->bug->osList, $bug->os);
break;
case 'browser':
echo zget($this->lang->bug->browserList, $bug->browser);
break;
case 'mailto':
$mailto = explode(',', $bug->mailto);
foreach($mailto as $account)
{
$account = trim($account);
if(empty($account)) continue;
echo zget($users, $account) . "  ";
}
break;
case 'found':
echo zget($users, $bug->found);
break;
case 'openedBy':
echo zget($users, $bug->openedBy);
break;
@@ -2394,12 +2427,15 @@ class bugModel extends model
case 'closedBy':
echo zget($users, $bug->closedBy);
break;
case 'lastEditedDate':
echo substr($bug->lastEditedDate, 5, 11);
break;
case 'closedDate':
echo substr($bug->closedDate, 5, 11);
break;
case 'lastEditedBy':
echo zget($users, $bug->lastEditedBy);
break;
case 'lastEditedDate':
echo substr($bug->lastEditedDate, 5, 11);
break;
case 'actions':
$params = "bugID=$bug->id";
common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'search', '', 'iframe', true);
+27 -6
View File
@@ -168,16 +168,37 @@ js::set('branch', $branch);
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/browsedata.html.php';
$vars = "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
include $file2Include;
if($useDatatable) include '../../common/view/datatable.html.php';
$setting = $this->datatable->getSetting('bug');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='bugList' data-checkable='true' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='bugIDList[]'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns ++;
}
}
?>
</tr>
</thead>
<tbody>
<?php foreach($bugs as $bug):?>
<tr class='text-center' data-id='<?php echo $bug->id?>'>
<?php foreach ($setting as $key => $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs, $projects, $plans, $stories, $tasks);?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<?php
$columns = $this->cookie->windowWidth >= $this->config->wideSize ? 13 : 11;
if($browseType == 'needconfirm') $columns = 8;
?>
<td colspan='<?php echo $columns;?>'>
<?php if(!empty($bugs)):?>
<div class='table-actions clearfix'>
-114
View File
@@ -1,114 +0,0 @@
<?php
/**
* The browse data view file of bug module of ZenTaoPMS.
*
* @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 bug
* @version $Id$
* @link http://www.zentao.net
*/
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed table-selectable' id='bugList'>
<thead>
<tr>
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-severity'> <?php common::printOrderLink('severity', $orderBy, $vars, $lang->bug->severityAB);?></th>
<th class='w-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
<th class='w-100px'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->bug->statusAB);?></th>
<th class='w-80px'> <?php common::printOrderLink('deadline', $orderBy, $vars, $lang->bug->deadline);?></th>
<?php if($browseType == 'needconfirm'):?>
<th class='w-200px'><?php common::printOrderLink('story', $orderBy, $vars, $lang->bug->story);?></th>
<th class='w-50px'><?php echo $lang->actions;?></th>
<?php else:?>
<th class='w-user'><?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<th class='w-date'><?php common::printOrderLink('openedDate', $orderBy, $vars, $lang->bug->openedDateAB);?></th>
<?php endif;?>
<th class='w-user'><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->assignedToAB);?></th>
<th class='w-user'><?php common::printOrderLink('resolvedBy', $orderBy, $vars, $lang->bug->resolvedByAB);?></th>
<th class='w-resolution'><?php common::printOrderLink('resolution', $orderBy, $vars, $lang->bug->resolutionAB);?></th>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<th class='w-date'><?php common::printOrderLink('resolvedDate', $orderBy, $vars, $lang->bug->resolvedDateAB);?></th>
<?php endif;?>
<th class='w-140px {sorter:false}'><?php echo $lang->actions;?></th>
<?php endif;?>
</tr>
</thead>
<?php if($bugs):?>
<tbody>
<?php foreach($bugs as $bug):?>
<?php $bugLink = inlink('view', "bugID=$bug->id");?>
<tr class='text-center'>
<td class='cell-id bug-<?php echo $bug->status;?> strong text-left'>
<input type='checkbox' name='bugIDList[<?php echo $bug->id ?>]' value='<?php echo $bug->id;?>'/>
<?php echo html::a($bugLink, sprintf('%03d', $bug->id));?>
</td>
<td><span class='<?php echo 'severity' . zget($lang->bug->severityList, $bug->severity, $bug->severity);?>'><?php echo zget($lang->bug->severityList, $bug->severity, $bug->severity);?></span></td>
<td><span class='<?php echo 'pri' . zget($lang->bug->priList, $bug->pri, $bug->pri);?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri);?></span></td>
<?php $class = 'confirm' . $bug->confirmed;?>
<td class='text-left' title="<?php echo $bug->title?>">
<?php
echo "<span class='$class'>[{$lang->bug->confirmedList[$bug->confirmed]}]</span> ";
if($bug->branch)echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>{$branches[$bug->branch]}</span> ";
if($modulePairs and $bug->module)echo "<span title='{$lang->bug->module}' class='label label-info label-badge'>{$modulePairs[$bug->module]}</span> ";
echo html::a($bugLink, $bug->title, null, "style='color: $bug->color'");
?>
</td>
<td class='bug-<?php echo $bug->status?>'>
<?php
if($bug->needconfirm)
{
echo "(<span class='warning'>{$lang->story->changed}</span> ";
echo html::a($this->createLink('bug', 'confirmStoryChange', "bugID=$bug->id"), $lang->confirm, 'hiddenwin');
echo ")";
}
else
{
echo $lang->bug->statusList[$bug->status];
}
?>
</td>
<td class="<?php if(isset($bug->delay)) echo 'delayed';?>"><?php if(substr($bug->deadline, 0, 4) > 0) echo substr($bug->deadline, 5, 6)?></td>
<?php if($browseType == 'needconfirm'):?>
<td class='text-left' title="<?php echo $bug->storyTitle?>"><?php echo html::a($this->createLink('story', 'view', "stoyID=$bug->story"), $bug->storyTitle, '_blank');?></td>
<td><?php $lang->bug->confirmStoryChange = $lang->confirm; common::printIcon('bug', 'confirmStoryChange', "bugID=$bug->id", '', 'list', '', 'hiddenwin')?></td>
<?php else:?>
<td><?php echo zget($users, $bug->openedBy, $bug->openedBy);?></td>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<td><?php echo substr($bug->openedDate, 5, 11)?></td>
<?php endif;?>
<td <?php if($bug->assignedTo == $this->app->user->account) echo 'class="red"';?>><?php echo zget($users, $bug->assignedTo, $bug->assignedTo);?></td>
<td><?php echo zget($users, $bug->resolvedBy, $bug->resolvedBy)?></td>
<td><?php echo zget($lang->bug->resolutionList, $bug->resolution);?></td>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<td><?php echo substr($bug->resolvedDate, 5, 11)?></td>
<?php endif;?>
<td class='text-right'>
<?php
$params = "bugID=$bug->id";
common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'search', '', 'iframe', true);
common::printIcon('bug', 'assignTo', $params, $bug, 'list', '', '', 'iframe', true);
common::printIcon('bug', 'resolve', $params, $bug, 'list', '', '', 'iframe', true);
common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true);
common::printIcon('bug', 'edit', $params, $bug, 'list');
common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=bugID=$bug->id", $bug, 'list', 'copy');
?>
</td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
<?php endif;?>
-29
View File
@@ -1,29 +0,0 @@
<?php
/**
* The datatable data view file of bug module of ZenTaoPMS.
*
* @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 bug
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/datatable.html.php';
$setting = $this->datatable->getSetting('bug');
$widths = $this->datatable->setFixedFieldWidth($setting);
extract($widths);
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='bugList' data-checkable='true' data-fixed-left-width='<?php echo $leftWidth?>' data-fixed-right-width='<?php echo $rightWidth?>' data-custom-menu='true' data-checkbox-name='bugIDList[]'>
<thead>
<tr><?php foreach ($setting as $key => $value) $this->datatable->printHead($value, $orderBy, $vars);?></tr>
</thead>
<tbody>
<?php foreach($bugs as $bug):?>
<tr class='text-center' data-id='<?php echo $bug->id?>'>
<?php foreach ($setting as $key => $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs);?>
</tr>
<?php endforeach;?>
</tbody>
+6
View File
@@ -341,6 +341,7 @@ $lang->admin->menu->safe = array('link' => 'Security|admin|safe', 'alias' =
$lang->admin->menu->cron = array('link' => 'Cron|cron|index', 'subModule' => 'cron');
$lang->admin->menu->trashes = array('link' => 'Recycle|action|trash', 'subModule' => 'action');
$lang->admin->menu->dev = array('link' => 'Develop|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor');
$lang->admin->menu->entry = array('link' => 'API|entry|browse', 'alias' => 'create,edit', 'subModule' => 'entry,webhook');
$lang->admin->menu->sso = 'RangerTeam|admin|sso';
$lang->convert = new stdclass();
@@ -353,6 +354,8 @@ $lang->editor = new stdclass();
$lang->mail = new stdclass();
$lang->cron = new stdclass();
$lang->dev = new stdclass();
$lang->entry = new stdclass();
$lang->webhook = new stdclass();
$lang->search = new stdclass();
$lang->convert->menu = $lang->admin->menu;
@@ -365,6 +368,7 @@ $lang->custom->menu = $lang->admin->menu;
$lang->editor->menu = $lang->admin->menu;
$lang->mail->menu = $lang->admin->menu;
$lang->dev->menu = $lang->admin->menu;
$lang->webhook->menu = $lang->admin->menu;
/* 菜单分组。*/
$lang->menugroup = new stdclass();
@@ -395,6 +399,8 @@ $lang->menugroup->custom = 'admin';
$lang->menugroup->editor = 'admin';
$lang->menugroup->mail = 'admin';
$lang->menugroup->dev = 'admin';
$lang->menugroup->entry = 'admin';
$lang->menugroup->webhook = 'admin';
/* 错误提示信息。*/
$lang->error = new stdclass();
+4
View File
@@ -118,6 +118,8 @@ $lang->admin->menuOrder[35] = 'cron';
$lang->admin->menuOrder[40] = 'backup';
$lang->admin->menuOrder[45] = 'dev';
$lang->admin->menuOrder[50] = 'safe';
$lang->admin->menuOrder[53] = 'entry';
$lang->admin->menuOrder[54] = 'webhook';
$lang->admin->menuOrder[55] = 'sso';
$lang->admin->menuOrder[60] = 'trashes';
$lang->convert->menuOrder = $lang->admin->menuOrder;
@@ -130,3 +132,5 @@ $lang->custom->menuOrder = $lang->admin->menuOrder;
$lang->editor->menuOrder = $lang->admin->menuOrder;
$lang->mail->menuOrder = $lang->admin->menuOrder;
$lang->dev->menuOrder = $lang->admin->menuOrder;
$lang->entry->menuOrder = $lang->admin->menuOrder;
$lang->webhook->menuOrder = $lang->admin->menuOrder;
+7
View File
@@ -341,6 +341,7 @@ $lang->admin->menu->safe = array('link' => '安全|admin|safe', 'alias' =>
$lang->admin->menu->cron = array('link' => '计划任务|cron|index', 'subModule' => 'cron');
$lang->admin->menu->trashes = array('link' => '回收站|action|trash', 'subModule' => 'action');
$lang->admin->menu->dev = array('link' => '二次开发|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor');
$lang->admin->menu->entry = array('link' => '接口|entry|browse', 'alias' => 'create,edit', 'subModule' => 'entry,webhook');
$lang->admin->menu->sso = '然之集成|admin|sso';
$lang->convert = new stdclass();
@@ -353,6 +354,8 @@ $lang->editor = new stdclass();
$lang->mail = new stdclass();
$lang->cron = new stdclass();
$lang->dev = new stdclass();
$lang->entry = new stdclass();
$lang->webhook = new stdclass();
$lang->search = new stdclass();
$lang->convert->menu = $lang->admin->menu;
@@ -365,6 +368,8 @@ $lang->custom->menu = $lang->admin->menu;
$lang->editor->menu = $lang->admin->menu;
$lang->mail->menu = $lang->admin->menu;
$lang->dev->menu = $lang->admin->menu;
$lang->entry->menu = $lang->admin->menu;
$lang->webhook->menu = $lang->admin->menu;
/* 菜单分组。*/
$lang->menugroup = new stdclass();
@@ -395,6 +400,8 @@ $lang->menugroup->custom = 'admin';
$lang->menugroup->editor = 'admin';
$lang->menugroup->mail = 'admin';
$lang->menugroup->dev = 'admin';
$lang->menugroup->entry = 'admin';
$lang->menugroup->webhook = 'admin';
/* 错误提示信息。*/
$lang->error = new stdclass();
+1 -1
View File
@@ -817,7 +817,7 @@ class commonModel extends model
if(strtolower($key) == 'closeddate' && $value == '') continue;
if($magicQuote) $value = stripslashes($value);
if($value != stripslashes($old->$key))
if(isset($old->$key) and $value != stripslashes($old->$key))
{
$diff = '';
if(substr_count($value, "\n") > 1 or
+9 -5
View File
@@ -9,17 +9,19 @@
<script>
$(function()
{
var table = $('#wrap > .outer > .main > form > table').first();
if($(table).length > 0)
var $table = $('#wrap > .outer > .main > form > table').first();
if($table.length > 0)
{
var $dropdown = $("<div class='datatable-menu-wrapper'><div class='dropdown datatable-menu'><button type='button' class='btn btn-link' data-toggle='dropdown'><i class='icon-cogs'></i> <span class='caret'></span></button></div></div>");
var $dropmenu = $("<ul class='dropdown-menu pull-right'></ul>");
$dropmenu.append("<li><a id='tableCustomBtn' href='<?php echo $this->createLink('datatable', 'ajaxCustom', 'id=' . $this->moduleName . '&method=' . $this->methodName)?>' data-toggle='modal' data-type='ajax'><?php echo $lang->datatable->custom?></a></li>");
$dropmenu.append("<li><a href='javascript:;' id='switchToDatatable'><?php echo $lang->datatable->switchToDatatable?></a></li>");
$dropdown.children('.dropdown').append($dropmenu);
$(table).before($dropdown);
$table.before($dropdown);
<?php if(!empty($setShowModule)):?>
$('.side .side-body .panel-body .tree').parent().append("<div class='text-right'><a href='javascript:;' data-toggle='showModuleModal'><?php echo $lang->datatable->showModule?></a></div>");
<?php endif;?>
$('#tableCustomBtn').modalTrigger();
$("a[data-toggle='showModuleModal']").click(function(){$('#showModuleModal').modal('show')});
}
@@ -33,20 +35,22 @@ $(function()
saveDatatableConfig('showModule', $('#showModuleModal input[name="showModule"]:checked').val(), true)
});
function saveDatatableConfig(name, value, reload)
function saveDatatableConfig(name, value, reload, global)
{
if('<?php echo $this->app->user->account?>' == 'guest') return;
datatableId = '<?php echo $datatableId?>';
if(typeof value === 'object') value = JSON.stringify(value);
if(typeof global === 'undefined') global = 0;
$.ajax(
{
type: "POST",
dataType: 'json',
data: {target: datatableId, name: name, value: value},
data: {target: datatableId, name: name, value: value, global: global},
success:function(){if(reload) window.location.reload();},
url: '<?php echo $this->createLink('datatable', 'ajaxSave')?>'
});
};
window.saveDatatableConfig = saveDatatableConfig;
});
</script>
<div class="modal fade" id="showModuleModal" tabindex="-1" role="dialog" aria-hidden="true">
+4 -3
View File
@@ -84,16 +84,17 @@ $(document).ready(function()
}
});
window.saveDatatableConfig = function(name, value, reload)
window.saveDatatableConfig = function(name, value, reload, global)
{
if('<?php echo $this->app->user->account?>' == 'guest') return;
var datatableId = '<?php echo $datatableId;?>';
if(typeof value === 'object') value = JSON.stringify(value);
if('<?php echo $this->app->user->account?>' == 'guest') return;
if(typeof global === 'undefined') global = 0;
$.ajax(
{
type: "POST",
dataType: 'json',
data: {target: datatableId, name: name, value: value},
data: {target: datatableId, name: name, value: value, global: global},
success:function(e){if(reload) window.location.reload();},
url: '<?php echo $this->createLink('datatable', 'ajaxSave')?>'
});
+1 -1
View File
@@ -94,7 +94,7 @@ js::set('confirmDelete', $lang->user->confirmDelete);
</tbody>
<tfoot>
<tr>
<td colspan='11'>
<td colspan='12'>
<div class='table-actions clearfix'>
<?php
if($canBatchEdit) echo html::selectButton();
+6 -4
View File
@@ -310,7 +310,7 @@ class custom extends control
if(is_array($menus))
{
foreach ($menus as $menu)
foreach($menus as $menu)
{
$menu = json_decode($menu);
$this->custom->saveCustomMenu($menu->value, $menu->module, isset($menu->method) ? $menu->method : '');
@@ -374,11 +374,13 @@ class custom extends control
* @access public
* @return void
*/
public function ajaxRestoreMenu($confirm = 'no')
public function ajaxRestoreMenu($setPublic = 0, $confirm = 'no')
{
if($confirm == 'no') die(js::confirm($this->lang->custom->confirmRestore, inlink('ajaxRestoreMenu', "confirm=yes")));
if($confirm == 'no') die(js::confirm($this->lang->custom->confirmRestore, inlink('ajaxRestoreMenu', "setPublic=$setPublic&confirm=yes")));
$this->loadModel('setting')->deleteItems("owner={$this->app->user->account}&module=common&section=customMenu");
$account = $this->app->user->account;
if($setPublic) $account = 'system';
$this->loadModel('setting')->deleteItems("owner={$account}&module=common&section=customMenu");
die(js::reload('parent.parent'));
}
}
+9 -2
View File
@@ -217,9 +217,10 @@ $(function()
});
});
postData = $.map(postData, JSON.stringify);
postData = $.map(postData, JSON.stringify);
setPublic = $('#setPublic1').prop('checked') ? 1 : 0;
$.post(createLink('custom', 'ajaxSetMenu'), {menus: postData}, function(data)
$.post(createLink('custom', 'ajaxSetMenu'), {menus: postData, setPublic: setPublic}, function(data)
{
if(data.result === 'success') window.parent.location.reload()
if(data.message) alert(data.message);
@@ -242,4 +243,10 @@ $(function()
{
window.parent.$.closeModal();
});
$('#resetMenuBtn').click(function()
{
var setPublic = $('#setPublic1').prop('checked') ? 1 : 0;
hiddenwin.location.href = createLink('custom', 'ajaxRestoreMenu', "public=" + setPublic);
});
});
+1
View File
@@ -13,6 +13,7 @@ $lang->custom->owner = 'Owner';
$lang->custom->module = 'Module';
$lang->custom->section = 'Section';
$lang->custom->lang = 'Language';
$lang->custom->setPublic = 'Set Public';
$lang->custom->object['story'] = 'Story';
$lang->custom->object['task'] = 'Task';
+1
View File
@@ -13,6 +13,7 @@ $lang->custom->owner = '所有者';
$lang->custom->module = '模块';
$lang->custom->section = '附加部分';
$lang->custom->lang = '所属语言';
$lang->custom->setPublic = '设为公共';
$lang->custom->object['story'] = '需求';
$lang->custom->object['task'] = '任务';
+2
View File
@@ -359,6 +359,8 @@ class customModel extends model
$account = $this->app->user->account;
$settingKey = '';
$setPublic = $this->post->setPublic;
if($setPublic) $account = 'system';
if(!is_string($menu)) $menu = json_encode($menu);
$flow = $this->config->global->flow;
+2 -1
View File
@@ -32,9 +32,10 @@
<?php endif;?>
</div>
<div class='text-left'>
<?php if(common::hasPriv('custom', 'setPublic')) echo html::checkbox('setPublic', array(1 => $lang->custom->setPublic));?>
<button id='saveMenuBtn' type='button' class='btn btn-primary'><?php echo $lang->save ?></button> &nbsp;
<button id='closeModalBtn' type='button' class='btn'><?php echo $lang->close ?></button> &nbsp;
<?php echo html::a(inlink('ajaxRestoreMenu'), $lang->custom->restore, 'hiddenwin', "class='btn'")?>
<button id='resetMenuBtn' type='button' class='btn'><?php echo $lang->custom->restore ?></button> &nbsp;
<span class='text-danger'> &nbsp; <i class="icon icon-info-sign"></i> <?php echo $lang->custom->menuTip ?></span>
</div>
</div>
+48 -11
View File
@@ -33,6 +33,7 @@ class datatable extends control
if(!empty($_POST))
{
$account = $this->app->user->account;
if($this->post->global) $account = 'system';
if($account == 'guest') $this->send(array('result' => 'fail', 'target' => $target, 'message' => 'guest.'));
$name = $account . '.datatable.' . $this->post->target . '.' . $this->post->name;
@@ -52,25 +53,61 @@ class datatable extends control
*/
public function ajaxCustom($module, $method)
{
$account = $this->app->user->account;
$name = 'owner=' . $account . '&module=datatable&section=' . $module . ucfirst($method) . '&key=cols';
$target = $module . ucfirst($method);
$mode = isset($this->config->datatable->$target->mode) ? $this->config->datatable->$target->mode : 'table';
$key = $mode == 'datatable' ? 'cols' : 'tablecols';
if($module == 'testtask')
{
$this->loadModel('testcase');
$this->app->loadConfig('testtask');
$this->config->testcase->datatable->defaultField = $this->config->testtask->datatable->defaultField;
$this->config->testcase->datatable->fieldList['assignedTo']['title'] = 'assignedTo';
$this->config->testcase->datatable->fieldList['assignedTo']['fixed'] = 'no';
$this->config->testcase->datatable->fieldList['assignedTo']['width'] = '80';
$this->config->testcase->datatable->fieldList['assignedTo']['required'] = 'no';
$this->config->testcase->datatable->fieldList['actions']['width'] = '100';
$this->config->testcase->datatable->fieldList['actions']['width'] = '100';
}
if($module == 'testcase')
{
$this->loadModel('testcase');
unset($this->config->testcase->datatable->fieldList['assignedTo']);
}
$module = zget($this->config->datatable->moduleAlias, $module, $module);
$this->view->cols = $this->datatable->getFieldList($module);
$this->view->setting = $this->loadModel('setting')->getItem($name);
if(empty($this->view->setting)) $this->view->setting = json_encode($this->config->$module->datatable->defaultField);
$this->view->module = $module;
$this->view->method = $method;
$this->view->mode = $mode;
$module = zget($this->config->datatable->moduleAlias, $module, $module);
$setting = '';
if(isset($this->config->datatable->$target->$key)) $setting = $this->config->datatable->$target->$key;
if(empty($setting))
{
$this->loadModel($module);
$setting = json_encode($this->config->$module->datatable->defaultField);
}
$this->view->cols = $this->datatable->getFieldList($module);
$this->view->setting = $setting;
$this->display();
}
/**
* Ajax reset cols
*
* @param string $module
* @param string $method
* @param string $confirm
* @access public
* @return void
*/
public function ajaxReset($module, $method, $system = 0, $confirm = 'no')
{
if($confirm == 'no') die(js::confirm($this->lang->datatable->confirmReset, inlink('ajaxReset', "module=$module&method=$method&system=$system&confirm=yes")));
$account = $this->app->user->account;
$target = $module . ucfirst($method);
$mode = isset($this->config->datatable->$target->mode) ? $this->config->datatable->$target->mode : 'table';
$key = $mode == 'datatable' ? 'cols' : 'tablecols';
if($system) $account = 'system';
$this->loadModel('setting')->deleteItems("owner=$account&module=datatable&section=$target&key=$key");
die(js::reload('parent'));
}
}
+4
View File
@@ -4,12 +4,16 @@ $lang->datatable->common = 'Data Table';
$lang->datatable->width = 'Width';
$lang->datatable->show = 'Show';
$lang->datatable->hide = 'Hide';
$lang->datatable->reset = 'Reset';
$lang->datatable->custom = 'Custom Columns';
$lang->datatable->customTip = 'Check Columns to Display';
$lang->datatable->switchToTable = 'Switch to Table';
$lang->datatable->switchToDatatable = 'Switch to Datatable';
$lang->datatable->required = 'Required';
$lang->datatable->confirmReset = 'Do you want to restore the default settings?';
$lang->datatable->setGlobal = 'Global';
$lang->datatable->resetGlobal = 'Reset Global Default';
$lang->datatable->branch = 'Branch';
$lang->datatable->platform = 'Platform';
+4
View File
@@ -4,12 +4,16 @@ $lang->datatable->common = '数据表格';
$lang->datatable->width = '宽度';
$lang->datatable->show = '显示';
$lang->datatable->hide = '隐藏';
$lang->datatable->reset = '恢复默认';
$lang->datatable->custom = '自定义列';
$lang->datatable->customTip = '勾选需要显示的列';
$lang->datatable->switchToTable = '切换到简单表格';
$lang->datatable->switchToDatatable = '切换到高级表格';
$lang->datatable->required = '必选';
$lang->datatable->confirmReset = '是否恢复默认设置?';
$lang->datatable->setGlobal = '全局';
$lang->datatable->resetGlobal = '全局恢复默认';
$lang->datatable->branch = '分支';
$lang->datatable->platform = '平台';
+11 -2
View File
@@ -49,9 +49,12 @@ class datatableModel extends model
{
$datatableId = $module . ucfirst($this->app->getMethodName());
$mode = isset($this->config->datatable->$datatableId->mode) ? $this->config->datatable->$datatableId->mode : 'table';
$key = $mode == 'datatable' ? 'cols' : 'tablecols';
$module = zget($this->config->datatable->moduleAlias, $module, $module);
if(!isset($this->config->$module)) $this->loadModel($module);
if(isset($this->config->datatable->$datatableId->cols)) $setting = json_decode($this->config->datatable->$datatableId->cols);
if(isset($this->config->datatable->$datatableId->$key)) $setting = json_decode($this->config->datatable->$datatableId->$key);
$fieldList = $this->getFieldList($module);
if(empty($setting))
@@ -69,6 +72,7 @@ class datatableModel extends model
$set->fixed = $fieldList[$id]['fixed'];
$set->title = $fieldList[$id]['title'];
$set->sort = isset($fieldList[$id]['sort']) ? $fieldList[$id]['sort'] : 'yes';
$set->name = isset($fieldList[$id]['name']) ? $fieldList[$id]['name'] : '';
$setting[$key] = $set;
}
}
@@ -120,7 +124,12 @@ class datatableModel extends model
$id = $col->id;
if($col->show)
{
echo "<th data-flex='" . ($col->fixed == 'no' ? 'true': 'false') . "' data-width='{$col->width}' class='w-$id'>";
$fixed = $col->fixed == 'no' ? 'true': 'false';
$width = is_numeric($col->width) ? "{$col->width}px" : $col->width;
$sorter = (isset($col->sort) and $col->sort == 'no') ? '' : '{sorter:false}';
$title = isset($col->name) ? "title='$col->name'" : '';
echo "<th data-flex='$fixed' data-width='$width' style='width:$width' class='w-$id $sorter' $title>";
if($id == 'actions')
{
echo $this->lang->actions;
+28 -7
View File
@@ -12,7 +12,7 @@
?>
<style>
.cols-list {margin-bottom: 10px;}
.cols-list .col {border: 1px solid #ddd; height: 30px; line-height: 29px; padding: 0 10px; border-bottom: none; background: #fff}
.cols-list .col {border: 1px solid #ddd; height: 30px; line-height: 29px; padding: 0 10px; border-bottom: none; background: #fff; float:none}
.cols-list .col.drag-shadow {border: 1px solid #ddd;}
.cols-list {border-bottom: 1px solid #ddd}
.cols-list .col:hover {background: #edf3fe}
@@ -62,19 +62,26 @@
<div class='clearfix col<?php echo ($required ? ' require' : '') . (' fixed-' . $fixed) ?>' data-key='<?php echo $key?>' data-fixed='<?php echo $fixed?>' data-width='<?php echo $col['width']?>'>
<i class='icon-ok'></i> &nbsp;<span class='title'><span class='title-bar'><strong><?php echo $col['title']?></strong><i class='icon-move'></i></span></span> <?php if($required) echo "<span class='text-muted'>({$lang->datatable->required})</span>"?>
<div class='actions pull-right'>
<span><span class='text-muted'><?php echo $lang->datatable->width?></span> <input type='text' class='form-control' <?php echo $autoWidth ? "disabled='disabled'" : '' ?>value='<?php echo $col['width']?>'><?php echo $autoWidth ? '&nbsp;' : 'px' ?></span>
<?php if(isset($col['name'])) echo html::hidden('name', $col['name'])?>
<span><span class='text-muted'><?php echo $lang->datatable->width?></span> <input type='text' id='width' class='form-control' value='<?php echo $col['width']?>'><?php echo $autoWidth ? '&nbsp;' : 'px' ?></span>
<button type='button' class='btn btn-link show-hide<?php echo $required ? ' disabled' : '' ?>'><span class='label-show'><?php echo $lang->datatable->show?></span><span class='text-muted'>/</span><span class='label-hide'><?php echo $lang->datatable->hide?></span></button>
</div>
</div>
<?php endforeach;?>
</div>
<div class='actions text-center'>
<button type='button' class='btn btn-primary btn-save' id='btnSaveCustom'><?php echo $lang->save ?></button> &nbsp;
<div class='actions text-left'>
<?php if(common::hasPriv('datatable', 'setGlobal')) echo html::checkbox('global', array(1 => $lang->datatable->setGlobal));?>
<button type='button' class='btn btn-primary btn-save' id='btnSaveCustom'><?php echo $lang->save ?></button>
<button type='button' class='btn btn-default' data-dismiss='modal'><?php echo $lang->close ?></button>
<button type='button' class='btn btn-default' id='resetBtn'><?php echo $lang->datatable->reset ?></button>
</div>
</div>
</div>
</div>
<?php
js::set('resetText', $lang->datatable->reset);
js::set('resetGlobalText', $lang->datatable->resetGlobal);
?>
<script>
$(function()
{
@@ -132,7 +139,6 @@ $(function()
if($cols.length < 2)
{
$list.addClass('sort-disabled');
$cols.find('input').val('auto').attr('disabled', 'disabled');
}
else
{
@@ -174,12 +180,27 @@ $(function()
var setting = $('.col').map(function(index)
{
var $col = $(this);
var sets = {id: $col.data('key'), order: index + 1, show: !$col.hasClass('disabled'), width: $col.find('input').val(), fixed: $col.data('fixed')};
var sets = {id: $col.data('key'), order: index + 1, show: !$col.hasClass('disabled'), width: $col.find('input#width').val(), fixed: $col.data('fixed')};
if(sets.width !== 'auto') sets.width += 'px';
if($col.find('#name').size() > 0) sets.name = $col.find('#name').val();
return sets;
}).get();
window.saveDatatableConfig('cols', setting, true);
window.saveDatatableConfig('<?php echo $mode == 'table' ? 'tablecols' : 'cols';?>', setting, true, $('#global1').prop('checked') ? 1 : 0);
});
$('#resetBtn').on("click", function()
{
var system = $('#global1').prop('checked') ? 1 : 0;
var param = "<?php echo "module=$module&method=$method"?>&system=" + system;
hiddenwin.location.href = createLink('datatable', 'ajaxReset', param);
})
$('#global1').change(function()
{
if($(this).prop('checked'))$('#resetBtn').text(resetGlobalText);
if(!$(this).prop('checked'))$('#resetBtn').text(resetText);
})
});
</script>
+11 -2
View File
@@ -457,8 +457,17 @@ class docModel extends model
->remove('comment,files,labels,uid')
->get();
if($doc->acl == 'private') $doc->users = $oldDoc->addedBy;
$oldDocContent = $this->dao->select('files,type')->from(TABLE_DOCCONTENT)->where('doc')->eq($docID)->andWhere('version')->eq($oldDoc->version)->fetch();
if($oldDocContent->type == 'markdown') $doc->content = str_replace('&gt;', '>', $doc->content);
if($oldDocContent)
{
$oldDoc->title = $oldDocContent->title;
$oldDoc->digest = $oldDocContent->digest;
$oldDoc->content = $oldDocContent->content;
$oldDoc->contentType = $oldDocContent->type;
if($oldDocContent->type == 'markdown') $doc->content = str_replace('&gt;', '>', $doc->content);
}
$lib = $this->getLibByID($doc->lib);
$doc = $this->loadModel('file')->processImgURL($doc, $this->config->doc->editor->edit['id'], $this->post->uid);
@@ -484,9 +493,9 @@ class docModel extends model
$docContent->title = $doc->title;
$docContent->content = $doc->content;
$docContent->version = $doc->version;
$docContent->digest = $doc->digest;
$docContent->type = $oldDocContent->type;
$docContent->files = $oldDocContent->files;
if(isset($doc->digest)) $docContent->digest = $doc->digest;
if($files) $docContent->files .= ',' . join(',', array_keys($files));
$docContent->files = trim($docContent->files, ',');
$this->dao->insert(TABLE_DOCCONTENT)->data($docContent)->exec();
+6
View File
@@ -0,0 +1,6 @@
<?php
$config->entry->create = new stdclass();
$config->entry->create->requiredFields = 'name, code, key';
$config->entry->edit = new stdclass();
$config->entry->edit->requiredFields = 'name, code, key';
+114
View File
@@ -0,0 +1,114 @@
<?php
/**
* The control file of entry module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package entry
* @version $Id$
* @link http://www.zentao.net
*/
class entry extends control
{
/**
* Browse entries.
*
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function browse($orderBy = 'id_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1)
{
$pager = $this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->view->title = $this->lang->entry->api . $this->lang->colon . $this->lang->entry->list;
$this->view->entries = $this->entry->getList($orderBy, $pager);
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->display();
}
/**
* Create an entry.
*
* @access public
* @return void
*/
public function create()
{
if($_POST)
{
$entryID = $this->entry->create();
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('entry', $entryID, 'created');
$this->send(array('result' => 'success', 'message' => $this->lang->entry->saveSuccess, 'locate' => inlink('browse')));
}
$this->view->title = $this->lang->entry->api . $this->lang->colon . $this->lang->entry->create;
$this->display();
}
/**
* Edit an entry.
*
* @param int $entryID
* @access public
* @return void
*/
public function edit($entryID)
{
if($_POST)
{
$changes = $this->entry->update($entryID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
if($changes)
{
$actionID = $this->loadModel('action')->create('entry', $entryID, 'edited');
$this->action->logHistory($actionID, $changes);
}
$this->send(array('result' => 'success', 'message' => $this->lang->entry->saveSuccess, 'locate' => inlink('browse')));
}
$entry = $this->entry->getById($entryID);
$this->view->title = $this->lang->entry->edit . $this->lang->colon . $entry->name;
$this->view->entry = $entry;
$this->display();
}
/**
* Delete an entry.
*
* @param int $entryID
* @access public
* @return void
*/
public function delete($entryID)
{
$this->entry->delete($entryID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->send(array('result' => 'success'));
}
/**
* Show access logs of entry.
*
* @param int $entryID
* @access public
* @return void
*/
public function log($entryID)
{
$entry = $this->entry->getById($entryID);
$this->view->title = $this->lang->entry->log . $this->lang->colon . $entry->name;
$this->view->actions = $this->loadModel('action')->getList('entry', $entryID);
$this->display();
}
}
+31
View File
@@ -0,0 +1,31 @@
/**
* create key for an entry.
*
* @access public
* @return void
*/
function createKey()
{
var chars = '0123456789abcdefghiklmnopqrstuvwxyz'.split('');
var key = '';
for(var i = 0; i < 32; i ++)
{
key += chars[Math.floor(Math.random() * chars.length)];
}
$('#key').val(key);
return false;
}
$('#allIP').change(function()
{
if($(this).prop('checked'))
{
$('#ip').attr('disabled', 'disabled');
}
else
{
$('#ip').removeAttr('disabled');
}
})
$('#name').focus();
+31
View File
@@ -0,0 +1,31 @@
/**
* create key for an entry.
*
* @access public
* @return void
*/
function createKey()
{
var chars = '0123456789abcdefghiklmnopqrstuvwxyz'.split('');
var key = '';
for(var i = 0; i < 32; i ++)
{
key += chars[Math.floor(Math.random() * chars.length)];
}
$('#key').val(key);
return false;
}
$('#allIP').change(function()
{
if($(this).prop('checked'))
{
$('#ip').attr('disabled', 'disabled');
}
else
{
$('#ip').removeAttr('disabled');
}
})
$('#name').focus();
+32
View File
@@ -0,0 +1,32 @@
<?php
$lang->entry->common = '应用';
$lang->entry->list = '应用列表';
$lang->entry->api = '接口';
$lang->entry->webhook = 'webhook';
$lang->entry->log = '日志';
$lang->entry->browse = '浏览应用';
$lang->entry->create = '添加应用';
$lang->entry->edit = '编辑应用';
$lang->entry->delete = '删除应用';
$lang->entry->createKey = '重新生成密钥';
$lang->entry->id = 'ID';
$lang->entry->name = '名称';
$lang->entry->code = '代号';
$lang->entry->key = '密钥';
$lang->entry->ip = 'IP';
$lang->entry->desc = '描述';
$lang->entry->createdBy = '由谁创建';
$lang->entry->createdDate = '创建时间';
$lang->entry->editedby = '最后编辑';
$lang->entry->editedDate = '编辑时间';
$lang->entry->saveSuccess = '保存成功';
$lang->entry->confirmDelete = '您确认要删除该应用吗?';
$lang->entry->note = new stdClass();
$lang->entry->note->name = '授权应用名称';
$lang->entry->note->code = '授权应用代号,必须为英文、数字或下划线的组合';
$lang->entry->note->ip = "允许访问应用的ip,多个ip用逗号隔开。支持IP段,如192.168.1.*";
$lang->entry->note->allIP = '无限制';
+108
View File
@@ -0,0 +1,108 @@
<?php
/**
* The model file of entry module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package entry
* @version $Id$
* @link http://www.zentao.net
*/
class entryModel extends model
{
/**
* Get an entry by id.
*
* @param int $entryID
* @access public
* @return array
*/
public function getById($entryID)
{
return $this->dao->select('*')->from(TABLE_ENTRY)->where('id')->eq($entryID)->fetch();
}
/**
* Get entry list.
*
* @param string $orderBy
* @param obejct $pager
* @access public
* @return array
*/
public function getList($orderBy = 'id_desc', $pager = null)
{
return $this->dao->select('*')->from(TABLE_ENTRY)->orderBy($orderBy)->page($pager)->fetchAll('id');
}
/**
* Create an entry.
*
* @access public
* @return bool | int
*/
public function create()
{
$entry = fixer::input('post')
->setDefault('ip', '*')
->setIF($this->post->allIP, 'ip', '*')
->add('createdBy', $this->app->user->account)
->add('createdDate', helper::now())
->remove('allIP')
->get();
$this->dao->insert(TABLE_ENTRY)->data($entry)
->batchCheck($this->config->entry->create->requiredFields, 'notempty')
->check('code', 'unique')
->autoCheck()
->exec();
if(dao::isError()) return false;
return $this->dao->lastInsertId();
}
/**
* Update an entry.
*
* @param int $entryID
* @access public
* @return bool | array
*/
public function update($entryID)
{
$oldEntry = $this->getById($entryID);
$entry = fixer::input('post')
->setDefault('ip', '*')
->setIF($this->post->allIP, 'ip', '*')
->add('editedBy', $this->app->user->account)
->add('editedDate', helper::now())
->remove('allIP')
->get();
$this->dao->update(TABLE_ENTRY)->data($entry)
->batchCheck($this->config->entry->edit->requiredFields, 'notempty')
->check('code', 'unique', "id!=$entryID")
->autoCheck()
->where('id')->eq($entryID)
->exec();
if(dao::isError()) return false;
return common::createChanges($oldEntry, $entry);
}
/**
* Delete an entry.
*
* @param int $entryID
* @param int $null
* @access public
* @return bool
*/
public function delete($entryID, $null = null)
{
$this->dao->delete()->from(TABLE_ENTRY)->where('id')->eq($entryID)->exec();
return !dao::isError();
}
}
+59
View File
@@ -0,0 +1,59 @@
<?php
/**
* The browse view file of entry module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package entry
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include 'header.html.php';?>
<?php js::set('confirmDelete', $lang->entry->confirmDelete);?>
<form id='ajaxForm' method='post'>
<table id='entryList' class='table table-condensed table-hover table-striped tablesorter'>
<thead>
<tr>
<?php $vars = "orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";?>
<th class='w-50px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->entry->id);?></th>
<th class='w-200px'><?php common::printOrderLink('name', $orderBy, $vars, $lang->entry->name);?></th>
<th class='w-100px'><?php common::printOrderLink('code', $orderBy, $vars, $lang->entry->code);?></th>
<th class='w-200px'><?php common::printOrderLink('key', $orderBy, $vars, $lang->entry->key);?></th>
<th class='w-200px'><?php common::printOrderLink('ip', $orderBy, $vars, $lang->entry->ip);?></th>
<th><?php echo common::printOrderLink('desc', $orderBy, $vars, $lang->entry->desc);?></th>
<th class='w-80px'><?php echo html::a('###', $lang->actions);?></th>
</tr>
</thead>
<tbody>
<?php foreach($entries as $entry):?>
<tr>
<td class='text-center'><?php echo $entry->id;?></td>
<td title='<?php echo $entry->name;?>'><?php echo $entry->name;?></td>
<td><?php echo $entry->code;?></td>
<td title='<?php echo $entry->key;?>'><?php echo $entry->key;?></td>
<td title='<?php echo $entry->ip;?>'><?php echo $entry->ip;?></td>
<td title='<?php echo $entry->desc;?>'><?php echo $entry->desc;?></td>
<td class='text-right'>
<?php
common::printIcon('entry', 'log', "entryID=$entry->id", '', 'list', 'file-text-o');
common::printIcon('entry', 'edit', "entryID=$entry->id", '', 'list');
if(common::hasPriv('entry', 'delete'))
{
$deleteURL = $this->createLink('entry', 'delete', "entryID=$entry->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"entryList\",confirmDelete)", '<i class="icon-remove"></i>', '', "title='{$lang->entry->delete}' class='btn-icon'");
}
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='7'><?php $pager->show();?></td>
</tr>
</tfoot>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>
+64
View File
@@ -0,0 +1,64 @@
<?php
/**
* The create view file of entry module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package entry
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/form.html.php';?>
<div class='container mw-800px'>
<div id="titlebar">
<div class="heading">
<strong><?php echo $lang->entry->api;?></strong>
<small class="text-muted"> <?php echo $lang->entry->create;?> <i class="icon-pencil"></i></small>
</div>
</div>
<form id='entryForm' method='post' class='ajaxForm'>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->entry->name;?></th>
<td><?php echo html::input('name', '', "class='form-control' title='{$lang->entry->note->name}' placeholder='{$lang->entry->note->name}'");?></td>
<td class='w-120px'></td>
</tr>
<tr>
<th><?php echo $lang->entry->code;?></th>
<td><?php echo html::input('code', '', "class='form-control' title='{$lang->entry->note->code}' placeholder='{$lang->entry->note->code}'");?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->entry->key;?></th>
<td><?php echo html::input('key', md5(rand()), "class='form-control' readonly='readonly'");?></td>
<td><span class="help-inline"><?php echo html::a('javascript:void(0)', $lang->entry->createKey, '', 'onclick="createKey()" tabIndex="-1"')?></span></td>
</tr>
<tr>
<th><?php echo $lang->entry->ip;?></th>
<td>
<div class='input-group'>
<?php echo html::input('ip', '', "class='form-control' title='{$lang->entry->note->ip}' placeholder='{$lang->entry->note->ip}'");?>
<div class='input-group-addon'>
<label class="checkbox-inline"><input type="checkbox" id="allIP" name="allIP" value="1"><?php echo $lang->entry->note->allIP;?></label>
</div>
</div>
</td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->entry->desc;?></th>
<td><?php echo html::textarea('desc', '', "rows='3' class='form-control'");?></td>
<td></td>
</tr>
<tr>
<th></th>
<td><?php echo html::submitButton();?></td>
<td></td>
</tr>
</table>
</form>
</div>
<?php include '../../common/view/footer.lite.html.php';?>
+64
View File
@@ -0,0 +1,64 @@
<?php
/**
* The edit view file of entry module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package entry
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/form.html.php';?>
<div class='container mw-800px'>
<div id="titlebar">
<div class="heading">
<strong><?php echo $lang->entry->api;?></strong>
<small class="text-muted"> <?php echo $lang->entry->edit;?> <i class="icon-pencil"></i></small>
</div>
</div>
<form id='entryForm' method='post' class='ajaxForm'>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->entry->name;?></th>
<td><?php echo html::input('name', $entry->name, "class='form-control' title='{$lang->entry->note->name}' placeholder='{$lang->entry->note->name}'");?></td>
<td class='w-120px'></td>
</tr>
<tr>
<th><?php echo $lang->entry->code;?></th>
<td><?php echo html::input('code', $entry->code, "class='form-control' title='{$lang->entry->note->code}' placeholder='{$lang->entry->note->code}'");?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->entry->key;?></th>
<td><?php echo html::input('key', $entry->key, "class='form-control' readonly='readonly'");?></td>
<td><span class="help-inline"><?php echo html::a('javascript:void(0)', $lang->entry->createKey, '', 'onclick="createKey()" tabIndex="-1"')?></span></td>
</tr>
<tr>
<th><?php echo $lang->entry->ip;?></th>
<td>
<div class='input-group'>
<?php echo html::input('ip', $entry->ip, "class='form-control' title='{$lang->entry->note->ip}' placeholder='{$lang->entry->note->ip}'");?>
<div class='input-group-addon'>
<label class="checkbox-inline"><input type="checkbox" id="allIP" name="allIP" value="1"><?php echo $lang->entry->note->allIP;?></label>
</div>
</div>
</td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->entry->desc;?></th>
<td><?php echo html::textarea('desc', $entry->desc, "rows='3' class='form-control'");?></td>
<td></td>
</tr>
<tr>
<th></th>
<td><?php echo html::submitButton();?></td>
<td></td>
</tr>
</table>
</form>
</div>
<?php include '../../common/view/footer.lite.html.php';?>
+29
View File
@@ -0,0 +1,29 @@
<?php
/**
* The header view file of entry module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package entry
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<div id='featurebar'>
<ul class='nav'>
<?php
echo '<li id="entry">'; common::printLink('entry', 'browse', "", $lang->entry->common); echo '</li>';
echo '<li id="webhook">'; common::printLink('webhook', 'browse', "", $lang->entry->webhook); echo '</li>';
?>
</ul>
<div class='actions'>
<div class='btn-group'>
<div class='btn-group' id='createActionMenu'>
<?php common::printIcon('entry', 'create', '', '', 'button', '', '', 'btn-primary');?>
</div>
</div>
</div>
</div>
<script>$('#<?php echo $this->moduleName;?>').addClass('active')</script>
+22
View File
@@ -0,0 +1,22 @@
<?php
/**
* The log view file of entry module of RanZhi.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package entry
* @version $Id$
* @link http://www.ranzhico.com
*/
?>
<?php include 'header.html.php';?>
<table class='table table-condensed table-hover table-striped'>
<thead>
<tr>
<th class='w-120px'><?php echo $lang->action->date;?></th>
<th></th>
</tr>
</thead>
</table>
<?php include '../../common/view/footer.html.php';?>
+15 -5
View File
@@ -714,17 +714,24 @@ $lang->mail->methodOrder[60] = 'sendcloudUser';
/* custom. */
$lang->resource->custom = new stdclass();
$lang->resource->custom->index = 'index';
$lang->resource->custom->set = 'set';
$lang->resource->custom->restore = 'restore';
$lang->resource->custom->flow = 'flow';
$lang->resource->custom->working = 'working';
$lang->resource->custom->index = 'index';
$lang->resource->custom->set = 'set';
$lang->resource->custom->restore = 'restore';
$lang->resource->custom->flow = 'flow';
$lang->resource->custom->working = 'working';
$lang->resource->custom->setPublic = 'setPublic';
$lang->custom->methodOrder[5] = 'index';
$lang->custom->methodOrder[10] = 'set';
$lang->custom->methodOrder[15] = 'restore';
$lang->custom->methodOrder[20] = 'flow';
$lang->custom->methodOrder[25] = 'working';
$lang->custom->methodOrder[30] = 'setPublic';
$lang->resource->datatable = new stdclass();
$lang->resource->datatable->setGlobal = 'setGlobal';
$lang->datatable->methodOrder[5] = 'setGlobal';
/* Subversion. */
$lang->resource->svn = new stdclass();
@@ -1327,6 +1334,9 @@ $lang->changelog['9.2'][] = 'testsuite-import';
$lang->changelog['9.2'][] = 'testsuite-showImport';
$lang->changelog['9.5'][] = 'bug-batchActivate';
$lang->changelog['9.6'][] = 'custom-setPublic';
$lang->changelog['9.6'][] = 'datatable-setGlobal';
global $config;
if($config->global->flow != 'full')
{
+29 -3
View File
@@ -104,13 +104,39 @@
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/browsedata.html.php';
$vars = "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
include $file2Include;
if($useDatatable) include '../../common/view/datatable.html.php';
if(!$useDatatable) include '../../common/view/tablesorter.html.php';
$setting = $this->datatable->getSetting('product');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='storyList' data-checkable='true' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='storyIDList[]'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns ++;
}
}
?>
</tr>
</thead>
<tbody>
<?php foreach($stories as $story):?>
<tr class='text-center' data-id='<?php echo $story->id?>'>
<?php foreach($setting as $key => $value) $this->story->printCell($value, $story, $users, $branches, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases);?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='13'>
<td colspan='<?php echo $columns?>'>
<div class='table-actions clearfix'>
<?php if(count($stories)):?>
<?php echo html::selectButton();?>
-103
View File
@@ -1,103 +0,0 @@
<?php
/**
* The browse data view file of product module of ZenTaoPMS.
*
* @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 product
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/tablesorter.html.php';?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed table-selectable' id='storyList'>
<thead>
<tr>
<th class='w-id {sorter:false}'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-pri {sorter:false}'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th class='w-p30 {sorter:false}'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->story->title);?></th>
<th class='w-90px {sorter:false}'><?php common::printOrderLink('plan', $orderBy, $vars, $lang->story->planAB);?></th>
<th class='w-user {sorter:false}'><?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
<th class='w-user {sorter:false}'><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->assignedToAB);?></th>
<th class='w-hour {sorter:false}'><?php common::printOrderLink('estimate', $orderBy, $vars, $lang->story->estimateAB);?></th>
<th class='w-50px {sorter:false}'><?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
<th class='w-70px {sorter:false}'><?php common::printOrderLink('stage', $orderBy, $vars, $lang->story->stageAB);?></th>
<th title='<?php echo $lang->story->taskCount?>' class='w-30px'><?php echo $lang->story->taskCountAB;?></th>
<th title='<?php echo $lang->story->bugCount?>' class='w-30px'><?php echo $lang->story->bugCountAB;?></th>
<th title='<?php echo $lang->story->caseCount?>' class='w-30px'><?php echo $lang->story->caseCountAB;?></th>
<th class='w-140px {sorter:false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<?php if($stories):?>
<tbody>
<?php foreach($stories as $key => $story):?>
<?php
$viewLink = $this->createLink('story', 'view', "storyID=$story->id");
$canView = common::hasPriv('story', 'view');
?>
<tr class='text-center'>
<td class='cell-id'>
<input type='checkbox' name='storyIDList[<?php echo $story->id;?>]' value='<?php echo $story->id;?>' />
<?php echo $canView ? html::a($viewLink, sprintf('%03d', $story->id)): sprintf('%03d', $story->id);?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->story->priList, $story->pri, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri)?></span></td>
<td class='text-left' title="<?php echo $story->title?>"><nobr>
<?php if($story->branch) echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>{$branches[$story->branch]}</span>"?>
<?php if($modulePairs and $story->module) echo "<span title='{$lang->story->module}' class='label label-info label-badge'>{$modulePairs[$story->module]}</span> "?>
<?php echo html::a($viewLink, $story->title, null, "style='color: $story->color'");?>
</nobr></td>
<td title="<?php echo $story->planTitle?>"><?php echo $story->planTitle;?></td>
<td><?php echo zget($users, $story->openedBy, $story->openedBy);?></td>
<td><?php echo zget($users, $story->assignedTo, $story->assignedTo);?></td>
<td><?php echo $story->estimate;?></td>
<td class='story-<?php echo $story->status;?>'><?php echo $lang->story->statusList[$story->status];?></td>
<td>
<?php
echo "<div" . (isset($storyStages[$story->id]) ? " class='popoverStage' data-toggle='popover' data-placement='bottom' data-target='\$next'" : '') . "'>";
echo $lang->story->stageList[$story->stage];
if(isset($storyStages[$story->id])) echo "<span class='pl-5px'><i class='icon icon-caret-down'></i></span>";
echo '</div>';
if(isset($storyStages[$story->id]))
{
echo "<div class='popover'>";
foreach($storyStages[$story->id] as $storyBranch => $storyStage) echo $branches[$storyBranch] . ": " . $lang->story->stageList[$storyStage->stage] . '<br />';
echo "</div>";
}
?>
</td>
<td class='linkbox'>
<?php
$tasksLink = $this->createLink('story', 'tasks', "storyID=$story->id");
$storyTasks[$story->id] > 0 ? print(html::a($tasksLink, $storyTasks[$story->id], '', 'class="iframe"')) : print(0);
?>
</td>
<td class='linkbox'>
<?php
$bugsLink = $this->createLink('story', 'bugs', "storyID=$story->id");
$storyBugs[$story->id] > 0 ? print(html::a($bugsLink, $storyBugs[$story->id], '', 'class="iframe"')) : print(0);
?>
</td>
<td class='linkbox'>
<?php
$casesLink = $this->createLink('story', 'cases', "storyID=$story->id");
$storyCases[$story->id] > 0 ? print(html::a($casesLink, $storyCases[$story->id], '', 'class="iframe"')) : print(0);
?>
</td>
<td class='text-right'>
<?php
$vars = "story={$story->id}";
common::printIcon('story', 'change', $vars, $story, 'list', 'random');
common::printIcon('story', 'review', $vars, $story, 'list', 'review');
common::printIcon('story', 'close', $vars, $story, 'list', 'off', '', 'iframe', true);
common::printIcon('story', 'edit', $vars, $story, 'list', 'pencil');
if($this->config->global->flow != 'onlyStory')
{
common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=&param=0&$vars", $story, 'list', 'sitemap');
}
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<?php endif;?>
@@ -1,29 +0,0 @@
<?php
/**
* The datatable data view file of product module of ZenTaoPMS.
*
* @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 product
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/datatable.html.php';
$setting = $this->datatable->getSetting('product');
$widths = $this->datatable->setFixedFieldWidth($setting);
extract($widths);
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='storyList' data-checkable='true' data-fixed-left-width='<?php echo $leftWidth?>' data-fixed-right-width='<?php echo $rightWidth?>' data-custom-menu='true' data-checkbox-name='storyIDList[]'>
<thead>
<tr><?php foreach($setting as $key => $value) $this->datatable->printHead($value, $orderBy, $vars);?></tr>
</thead>
<tbody>
<?php foreach($stories as $story):?>
<tr class='text-center' data-id='<?php echo $story->id?>'>
<?php foreach($setting as $key => $value) $this->story->printCell($value, $story, $users, $branches, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases);?>
</tr>
<?php endforeach;?>
</tbody>
+12 -4
View File
@@ -241,20 +241,28 @@ class productplanModel extends model
{
$this->loadModel('story');
$this->loadModel('action');
$stories = $this->story->getByList($this->post->stories);
$plan = $this->getByID($planID);
foreach($this->post->stories as $storyID)
{
if($this->session->currentProductType == 'normal')
if(!isset($stories[$storyID])) continue;
$story = $stories[$storyID];
if($this->session->currentProductType == 'normal' or $story->branch != 0 or empty($story->plan))
{
$this->dao->update(TABLE_STORY)->set("plan")->eq($planID)->where('id')->eq((int)$storyID)->exec();
}
else
{
$this->dao->update(TABLE_STORY)->set("plan")->eq($planID)->where('id')->eq((int)$storyID)->andWhere('branch')->ne('0')->exec();
$this->dao->update(TABLE_STORY)->set("plan=CONCAT(plan, ',', $planID)")->where('id')->eq((int)$storyID)->andWhere('branch')->eq('0')->exec();
$plans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('id')->in($story->plan)->fetchPairs('branch', 'id');
$plans[$plan->branch] = $planID;
$this->dao->update(TABLE_STORY)->set("plan")->eq(join(',', $plans))->where('id')->eq((int)$storyID)->andWhere('branch')->eq('0')->exec();
}
$this->action->create('story', $storyID, 'linked2plan', '', $planID);
$this->story->setStage($storyID);
}
}
}
/**
+3 -1
View File
@@ -1,4 +1,4 @@
table th.col-closed {width:15%}
table th.col-closed {width:12%}
#kanbanHeader th{border: 1px solid #ddd; padding:8px;}
#kanbanHeader .dropdown {display: inline-block; margin-left: 10px;}
#kanbanHeader .dropdown > a {color: #036}
@@ -63,6 +63,7 @@ table th.col-closed {width:15%}
.board {background: #ddd; color: #444; outline: 1px solid rgba(0,0,0,.1); outline-offset: -1px;}
.board-bug-wait,.board-task-wait {color: #2b529c; background-color: #E8EAF6}
.board-bug-doing,.board-task-doing {color: #D2322D; background-color: #FFEBEE;}
.board-task-pause {color: #fff; background-color: #E48600;}
.board-bug-done,.board-task-done {color: #229F24; background-color: #E8F5E9;}
.board-bug-closed,.board-task-closed {color: #666; background-color: #ccc;}
.board:hover {outline: 1px solid rgba(0,0,0,.3);}
@@ -79,6 +80,7 @@ table th.col-closed {width:15%}
.board.inverse:hover {color: #fff;}
.board-bug-cancel.inverse, .board-task-cancel.inverse {background: #333;}
.board-bug-wait.inverse, .board-task-wait.inverse {background: #2b529c}
.board-task-pause.inverse {background: #E48600}
.board-bug-doing.inverse, .board-task-doing.inverse {background: #D2322D}
.board-bug-done.inverse, .board-task-done.inverse {background: #229F24}
.board-bug-closed.inverse, .board-task-closed.inverse {background: #777;}
+2 -1
View File
@@ -17,7 +17,8 @@ $(function()
task:
{
wait : {doing: 'start', done: 'finish', cancel: 'cancel'},
doing : {done: 'finish'},
doing : {done: 'finish', pause: 'pause'},
pause : {doing: 'activate', done: 'finish', cancel: 'cancel'},
done : {doing: 'activate', closed: 'close'},
cancel : {doing: 'activate', closed: 'close'},
closed : {doing: 'activate'}
+2 -2
View File
@@ -10,7 +10,7 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include './taskheader.html.php';?>
<?php $taskCols = array('wait', 'doing', 'done', 'cancel', 'closed'); ?>
<?php $taskCols = array('wait', 'doing', 'pause', 'done', 'cancel', 'closed'); ?>
<div id='kanban'>
<table class='boards-layout table' id='kanbanHeader'>
<thead>
@@ -47,7 +47,7 @@
<?php if($hasStory):?>
<th class='w-p15 col-story'> </th>
<?php endif;?>
<?php foreach ($taskCols as $col):?><th class='col-<?php echo $col?>'></th><?php endforeach;?>
<?php foreach($taskCols as $col):?><th class='col-<?php echo $col?>'></th><?php endforeach;?>
</tr>
</thead>
<tbody>
+32 -2
View File
@@ -45,10 +45,40 @@ js::set('browseType', $browseType);
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/taskdata.html.php';
$vars = "projectID=$project->id&status=$status&parma=$param&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage";
include $file2Include;
if($useDatatable) include '../../common/view/datatable.html.php';
$setting = $this->datatable->getSetting('project');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='taskList' data-checkable='true' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='taskIDList[]'>
<thead>
<tr><?php
foreach ($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns++;
}
}
?></tr>
</thead>
<tbody>
<?php foreach($tasks as $task):?>
<tr class='text-center' data-id='<?php echo $task->id?>'>
<?php foreach ($setting as $key => $value) $this->task->printCell($value, $task, $users, $browseType, $branchGroups, $modulePairs);?>
</tr>
<?php if($task->children):?>
<?php foreach($task->children as $child):?>
<tr class='text-center table-children parent-<?php echo $task->id;?>' data-id='<?php echo $child->id?>'>
<?php foreach ($setting as $key => $value) $this->task->printCell($value, $child, $users, $browseType, $branchGroups, $modulePairs);?>
</tr>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<?php if(!isset($columns)) $columns = ($this->cookie->windowWidth > $this->config->wideSize ? 15 : 13) - ($project->type == 'sprint' ? 0 : 1);?>
+56 -27
View File
@@ -47,7 +47,7 @@ $config->story->custom->batchCreateFields = 'module,plan,spec,pri,estimate,revie
$config->story->custom->batchEditFields = 'branch,module,plan,estimate,pri,source,stage,closedBy,closedReason';
$config->story->datatable = new stdclass();
$config->story->datatable->defaultField = array('id', 'pri', 'title', 'plan', 'source', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'taskCount', 'bugCount', 'caseCount', 'actions');
$config->story->datatable->defaultField = array('id', 'pri', 'title', 'plan', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'taskCount', 'bugCount', 'caseCount', 'actions');
$config->story->datatable->fieldList['id']['title'] = 'idAB';
$config->story->datatable->fieldList['id']['fixed'] = 'left';
@@ -64,6 +64,16 @@ $config->story->datatable->fieldList['title']['fixed'] = 'left';
$config->story->datatable->fieldList['title']['width'] = 'auto';
$config->story->datatable->fieldList['title']['required'] = 'yes';
$config->story->datatable->fieldList['branch']['title'] = 'branch';
$config->story->datatable->fieldList['branch']['fixed'] = 'no';
$config->story->datatable->fieldList['branch']['width'] = '100';
$config->story->datatable->fieldList['branch']['required'] = 'no';
$config->story->datatable->fieldList['keywords']['title'] = 'keywords';
$config->story->datatable->fieldList['keywords']['fixed'] = 'no';
$config->story->datatable->fieldList['keywords']['width'] = '100';
$config->story->datatable->fieldList['keywords']['required'] = 'no';
$config->story->datatable->fieldList['plan']['title'] = 'planAB';
$config->story->datatable->fieldList['plan']['fixed'] = 'no';
$config->story->datatable->fieldList['plan']['width'] = '90';
@@ -81,37 +91,19 @@ $config->story->datatable->fieldList['sourceNote']['required'] = 'no';
$config->story->datatable->fieldList['status']['title'] = 'statusAB';
$config->story->datatable->fieldList['status']['fixed'] = 'no';
$config->story->datatable->fieldList['status']['width'] = '80';
$config->story->datatable->fieldList['status']['width'] = '50';
$config->story->datatable->fieldList['status']['required'] = 'no';
$config->story->datatable->fieldList['estimate']['title'] = 'estimateAB';
$config->story->datatable->fieldList['estimate']['fixed'] = 'no';
$config->story->datatable->fieldList['estimate']['width'] = '80';
$config->story->datatable->fieldList['estimate']['width'] = '50';
$config->story->datatable->fieldList['estimate']['required'] = 'no';
$config->story->datatable->fieldList['stage']['title'] = 'stageAB';
$config->story->datatable->fieldList['stage']['fixed'] = 'no';
$config->story->datatable->fieldList['stage']['width'] = '90';
$config->story->datatable->fieldList['stage']['width'] = '70';
$config->story->datatable->fieldList['stage']['required'] = 'no';
$config->story->datatable->fieldList['taskCount']['title'] = 'taskCount';
$config->story->datatable->fieldList['taskCount']['fixed'] = 'no';
$config->story->datatable->fieldList['taskCount']['width'] = '90';
$config->story->datatable->fieldList['taskCount']['required'] = 'no';
$config->story->datatable->fieldList['taskCount']['sort'] = 'no';
$config->story->datatable->fieldList['bugCount']['title'] = 'bugCount';
$config->story->datatable->fieldList['bugCount']['fixed'] = 'no';
$config->story->datatable->fieldList['bugCount']['width'] = '90';
$config->story->datatable->fieldList['bugCount']['required'] = 'no';
$config->story->datatable->fieldList['bugCount']['sort'] = 'no';
$config->story->datatable->fieldList['caseCount']['title'] = 'caseCount';
$config->story->datatable->fieldList['caseCount']['fixed'] = 'no';
$config->story->datatable->fieldList['caseCount']['width'] = '90';
$config->story->datatable->fieldList['caseCount']['required'] = 'no';
$config->story->datatable->fieldList['caseCount']['sort'] = 'no';
$config->story->datatable->fieldList['openedBy']['title'] = 'openedByAB';
$config->story->datatable->fieldList['openedBy']['fixed'] = 'no';
$config->story->datatable->fieldList['openedBy']['width'] = '80';
@@ -157,12 +149,49 @@ $config->story->datatable->fieldList['closedReason']['fixed'] = 'no';
$config->story->datatable->fieldList['closedReason']['width'] = '90';
$config->story->datatable->fieldList['closedReason']['required'] = 'no';
$config->story->datatable->fieldList['lastEditedBy']['title'] = 'lastEditedBy';
$config->story->datatable->fieldList['lastEditedBy']['fixed'] = 'no';
$config->story->datatable->fieldList['lastEditedBy']['width'] = '80';
$config->story->datatable->fieldList['lastEditedBy']['required'] = 'no';
$config->story->datatable->fieldList['lastEditedDate']['title'] = 'lastEditedDate';
$config->story->datatable->fieldList['lastEditedDate']['fixed'] = 'no';
$config->story->datatable->fieldList['lastEditedDate']['width'] = '90';
$config->story->datatable->fieldList['lastEditedDate']['required'] = 'no';
$config->story->datatable->fieldList['mailto']['title'] = 'mailto';
$config->story->datatable->fieldList['mailto']['fixed'] = 'no';
$config->story->datatable->fieldList['mailto']['width'] = '100';
$config->story->datatable->fieldList['mailto']['required'] = 'no';
$config->story->datatable->fieldList['version']['title'] = 'version';
$config->story->datatable->fieldList['version']['fixed'] = 'no';
$config->story->datatable->fieldList['version']['width'] = '60';
$config->story->datatable->fieldList['version']['required'] = 'no';
global $lang;
$config->story->datatable->fieldList['taskCount']['title'] = 'T';
$config->story->datatable->fieldList['taskCount']['fixed'] = 'no';
$config->story->datatable->fieldList['taskCount']['width'] = '30';
$config->story->datatable->fieldList['taskCount']['required'] = 'no';
$config->story->datatable->fieldList['taskCount']['sort'] = 'no';
$config->story->datatable->fieldList['taskCount']['name'] = $lang->story->taskCount;
$config->story->datatable->fieldList['bugCount']['title'] = 'B';
$config->story->datatable->fieldList['bugCount']['fixed'] = 'no';
$config->story->datatable->fieldList['bugCount']['width'] = '30';
$config->story->datatable->fieldList['bugCount']['required'] = 'no';
$config->story->datatable->fieldList['bugCount']['sort'] = 'no';
$config->story->datatable->fieldList['bugCount']['name'] = $lang->story->bugCount;
$config->story->datatable->fieldList['caseCount']['title'] = 'C';
$config->story->datatable->fieldList['caseCount']['fixed'] = 'no';
$config->story->datatable->fieldList['caseCount']['width'] = '30';
$config->story->datatable->fieldList['caseCount']['required'] = 'no';
$config->story->datatable->fieldList['caseCount']['sort'] = 'no';
$config->story->datatable->fieldList['caseCount']['name'] = $lang->story->caseCount;
$config->story->datatable->fieldList['actions']['title'] = 'actions';
$config->story->datatable->fieldList['actions']['fixed'] = 'right';
$config->story->datatable->fieldList['actions']['width'] = '140';
$config->story->datatable->fieldList['actions']['required'] = 'yes';
$config->story->datatable->fieldList['branch']['title'] = 'branch';
$config->story->datatable->fieldList['branch']['fixed'] = 'left';
$config->story->datatable->fieldList['branch']['width'] = '100';
$config->story->datatable->fieldList['branch']['required'] = 'no';
+21
View File
@@ -2285,6 +2285,9 @@ class storyModel extends model
case 'branch':
echo $branches[$story->branch];
break;
case 'keywords':
echo $story->keywords;
break;
case 'source':
echo zget($this->lang->story->sourceList, $story->source, $story->source);
break;
@@ -2348,6 +2351,24 @@ class storyModel extends model
case 'closedReason':
echo zget($this->lang->story->reasonList, $story->closedReason, $story->closedReason);
break;
case 'lastEditedBy':
echo zget($users, $story->lastEditedBy, $story->lastEditedBy);
break;
case 'lastEditedDate':
echo substr($story->lastEditedDate, 5, 11);
break;
case 'mailto':
$mailto = explode(',', $story->mailto);
foreach($mailto as $account)
{
$account = trim($account);
if(empty($account)) continue;
echo zget($users, $account) . ' &nbsp;';
}
break;
case 'version':
echo $story->version;
break;
case 'actions':
$vars = "story={$story->id}";
common::printIcon('story', 'change', $vars, $story, 'list', 'random');
+16 -1
View File
@@ -58,7 +58,7 @@ if($config->global->flow == 'onlyTask')
}
$config->task->datatable = new stdclass();
$config->task->datatable->defaultField = array('id', 'pri', 'name', 'status', 'deadline', 'openedDate', 'assignedTo', 'finishedBy', 'finishedDate', 'estimate', 'consumed', 'left', 'story', 'actions');
$config->task->datatable->defaultField = array('id', 'pri', 'name', 'status', 'deadline', 'openedDate', 'assignedTo', 'finishedBy', 'estimate', 'consumed', 'left', 'story', 'actions');
$config->task->datatable->fieldList['id']['title'] = 'idAB';
$config->task->datatable->fieldList['id']['fixed'] = 'left';
@@ -181,6 +181,21 @@ $config->task->datatable->fieldList['story']['fixed'] = 'no';
$config->task->datatable->fieldList['story']['width'] = '80';
$config->task->datatable->fieldList['story']['required'] = 'no';
$config->task->datatable->fieldList['mailto']['title'] = 'mailto';
$config->task->datatable->fieldList['mailto']['fixed'] = 'no';
$config->task->datatable->fieldList['mailto']['width'] = '100';
$config->task->datatable->fieldList['mailto']['required'] = 'no';
$config->task->datatable->fieldList['lastEditedBy']['title'] = 'lastEditedBy';
$config->task->datatable->fieldList['lastEditedBy']['fixed'] = 'no';
$config->task->datatable->fieldList['lastEditedBy']['width'] = '80';
$config->task->datatable->fieldList['lastEditedBy']['required'] = 'no';
$config->task->datatable->fieldList['lastEditedDate']['title'] = 'lastEditedDate';
$config->task->datatable->fieldList['lastEditedDate']['fixed'] = 'no';
$config->task->datatable->fieldList['lastEditedDate']['width'] = '90';
$config->task->datatable->fieldList['lastEditedDate']['required'] = 'no';
$config->task->datatable->fieldList['actions']['title'] = 'actions';
$config->task->datatable->fieldList['actions']['fixed'] = 'right';
$config->task->datatable->fieldList['actions']['width'] = '180';
+15
View File
@@ -1904,6 +1904,21 @@ class taskModel extends model
if(!common::printLink('story', 'view', "storyid=$task->storyID", $task->storyTitle)) print $task->storyTitle;
}
break;
case 'mailto':
$mailto = explode(',', $task->mailto);
foreach($mailto as $account)
{
$account = trim($account);
if(empty($account)) continue;
echo zget($users, $account) . ' &nbsp;';
}
break;
case 'lastEditedBy':
echo zget($users, $task->lastEditedBy, $task->lastEditedBy);
break;
case 'lastEditedDate':
echo substr($task->lastEditedDate, 5, 11);
break;
case 'actions':
common::printIcon('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $task, 'list', '', '', 'iframe', true);
common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', '', '', 'iframe', true);
+72 -29
View File
@@ -91,9 +91,14 @@ $config->testcase->datatable->fieldList['title']['fixed'] = 'left';
$config->testcase->datatable->fieldList['title']['width'] = 'auto';
$config->testcase->datatable->fieldList['title']['required'] = 'yes';
$config->testcase->datatable->fieldList['branch']['title'] = 'branch';
$config->testcase->datatable->fieldList['branch']['fixed'] = 'left';
$config->testcase->datatable->fieldList['branch']['width'] = '100';
$config->testcase->datatable->fieldList['branch']['required'] = 'no';
$config->testcase->datatable->fieldList['type']['title'] = 'type';
$config->testcase->datatable->fieldList['type']['fixed'] = 'no';
$config->testcase->datatable->fieldList['type']['width'] = '90';
$config->testcase->datatable->fieldList['type']['width'] = '80';
$config->testcase->datatable->fieldList['type']['required'] = 'no';
$config->testcase->datatable->fieldList['stage']['title'] = 'stage';
@@ -101,10 +106,20 @@ $config->testcase->datatable->fieldList['stage']['fixed'] = 'no';
$config->testcase->datatable->fieldList['stage']['width'] = '110';
$config->testcase->datatable->fieldList['stage']['required'] = 'no';
$config->testcase->datatable->fieldList['status']['title'] = 'statusAB';
$config->testcase->datatable->fieldList['status']['fixed'] = 'no';
$config->testcase->datatable->fieldList['status']['width'] = '80';
$config->testcase->datatable->fieldList['status']['required'] = 'no';
$config->testcase->datatable->fieldList['precondition']['title'] = 'precondition';
$config->testcase->datatable->fieldList['precondition']['fixed'] = 'no';
$config->testcase->datatable->fieldList['precondition']['width'] = '120';
$config->testcase->datatable->fieldList['precondition']['required'] = 'no';
$config->testcase->datatable->fieldList['keywords']['title'] = 'keywords';
$config->testcase->datatable->fieldList['keywords']['fixed'] = 'no';
$config->testcase->datatable->fieldList['keywords']['width'] = '100';
$config->testcase->datatable->fieldList['keywords']['required'] = 'no';
$config->testcase->datatable->fieldList['assignedTo']['title'] = 'assignedTo';
$config->testcase->datatable->fieldList['assignedTo']['fixed'] = 'no';
$config->testcase->datatable->fieldList['assignedTo']['width'] = '80';
$config->testcase->datatable->fieldList['assignedTo']['required'] = 'no';
$config->testcase->datatable->fieldList['openedBy']['title'] = 'openedByAB';
$config->testcase->datatable->fieldList['openedBy']['fixed'] = 'no';
@@ -116,6 +131,16 @@ $config->testcase->datatable->fieldList['openedDate']['fixed'] = 'no';
$config->testcase->datatable->fieldList['openedDate']['width'] = '90';
$config->testcase->datatable->fieldList['openedDate']['required'] = 'no';
$config->testcase->datatable->fieldList['reviewedBy']['title'] = 'reviewedBy';
$config->testcase->datatable->fieldList['reviewedBy']['fixed'] = 'no';
$config->testcase->datatable->fieldList['reviewedBy']['width'] = '80';
$config->testcase->datatable->fieldList['reviewedBy']['required'] = 'no';
$config->testcase->datatable->fieldList['reviewedDate']['title'] = 'reviewedDate';
$config->testcase->datatable->fieldList['reviewedDate']['fixed'] = 'no';
$config->testcase->datatable->fieldList['reviewedDate']['width'] = '90';
$config->testcase->datatable->fieldList['reviewedDate']['required'] = 'no';
$config->testcase->datatable->fieldList['lastRunner']['title'] = 'lastRunner';
$config->testcase->datatable->fieldList['lastRunner']['fixed'] = 'no';
$config->testcase->datatable->fieldList['lastRunner']['width'] = '80';
@@ -123,7 +148,7 @@ $config->testcase->datatable->fieldList['lastRunner']['required'] = 'no';
$config->testcase->datatable->fieldList['lastRunDate']['title'] = 'lastRunDate';
$config->testcase->datatable->fieldList['lastRunDate']['fixed'] = 'no';
$config->testcase->datatable->fieldList['lastRunDate']['width'] = '90';
$config->testcase->datatable->fieldList['lastRunDate']['width'] = '120';
$config->testcase->datatable->fieldList['lastRunDate']['required'] = 'no';
$config->testcase->datatable->fieldList['lastRunResult']['title'] = 'lastRunResult';
@@ -131,36 +156,54 @@ $config->testcase->datatable->fieldList['lastRunResult']['fixed'] = 'no';
$config->testcase->datatable->fieldList['lastRunResult']['width'] = '80';
$config->testcase->datatable->fieldList['lastRunResult']['required'] = 'no';
$config->testcase->datatable->fieldList['status']['title'] = 'statusAB';
$config->testcase->datatable->fieldList['status']['fixed'] = 'no';
$config->testcase->datatable->fieldList['status']['width'] = '100';
$config->testcase->datatable->fieldList['status']['required'] = 'no';
$config->testcase->datatable->fieldList['lastEditedBy']['title'] = 'lastEditedBy';
$config->testcase->datatable->fieldList['lastEditedBy']['fixed'] = 'no';
$config->testcase->datatable->fieldList['lastEditedBy']['width'] = '80';
$config->testcase->datatable->fieldList['lastEditedBy']['required'] = 'no';
$config->testcase->datatable->fieldList['lastEditedDate']['title'] = 'lastEditedDate';
$config->testcase->datatable->fieldList['lastEditedDate']['fixed'] = 'no';
$config->testcase->datatable->fieldList['lastEditedDate']['width'] = '90';
$config->testcase->datatable->fieldList['lastEditedDate']['required'] = 'no';
$config->testcase->datatable->fieldList['version']['title'] = 'version';
$config->testcase->datatable->fieldList['version']['fixed'] = 'no';
$config->testcase->datatable->fieldList['version']['width'] = '60';
$config->testcase->datatable->fieldList['version']['required'] = 'no';
$config->testcase->datatable->fieldList['story']['title'] = 'story';
$config->testcase->datatable->fieldList['story']['fixed'] = 'no';
$config->testcase->datatable->fieldList['story']['width'] = '90';
$config->testcase->datatable->fieldList['story']['required'] = 'no';
$config->testcase->datatable->fieldList['bugs']['title'] = 'B';
$config->testcase->datatable->fieldList['bugs']['fixed'] = 'no';
$config->testcase->datatable->fieldList['bugs']['width'] = '30';
$config->testcase->datatable->fieldList['bugs']['required'] = 'no';
$config->testcase->datatable->fieldList['bugs']['sort'] = 'no';
$config->testcase->datatable->fieldList['bugs']['name'] = $lang->testcase->bugs;
$config->testcase->datatable->fieldList['results']['title'] = 'R';
$config->testcase->datatable->fieldList['results']['fixed'] = 'no';
$config->testcase->datatable->fieldList['results']['width'] = '30';
$config->testcase->datatable->fieldList['results']['required'] = 'no';
$config->testcase->datatable->fieldList['results']['sort'] = 'no';
$config->testcase->datatable->fieldList['results']['name'] = $lang->testcase->results;
$config->testcase->datatable->fieldList['stepNumber']['title'] = 'S';
$config->testcase->datatable->fieldList['stepNumber']['fixed'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['width'] = '30';
$config->testcase->datatable->fieldList['stepNumber']['required'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['sort'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['name'] = $lang->testcase->stepNumber;
$config->testcase->datatable->fieldList['actions']['title'] = 'actions';
$config->testcase->datatable->fieldList['actions']['fixed'] = 'right';
$config->testcase->datatable->fieldList['actions']['width'] = '140';
$config->testcase->datatable->fieldList['actions']['required'] = 'yes';
$config->testcase->datatable->fieldList['actions']['sort'] = 'no';
$config->testcase->datatable->fieldList['branch']['title'] = 'branch';
$config->testcase->datatable->fieldList['branch']['fixed'] = 'left';
$config->testcase->datatable->fieldList['branch']['width'] = '100';
$config->testcase->datatable->fieldList['branch']['required'] = 'no';
$config->testcase->datatable->fieldList['bugs']['title'] = 'bugs';
$config->testcase->datatable->fieldList['bugs']['fixed'] = 'no';
$config->testcase->datatable->fieldList['bugs']['width'] = '80';
$config->testcase->datatable->fieldList['bugs']['required'] = 'no';
$config->testcase->datatable->fieldList['bugs']['sort'] = 'no';
$config->testcase->datatable->fieldList['results']['title'] = 'results';
$config->testcase->datatable->fieldList['results']['fixed'] = 'no';
$config->testcase->datatable->fieldList['results']['width'] = '80';
$config->testcase->datatable->fieldList['results']['required'] = 'no';
$config->testcase->datatable->fieldList['results']['sort'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['title'] = 'stepNumber';
$config->testcase->datatable->fieldList['stepNumber']['fixed'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['width'] = '80';
$config->testcase->datatable->fieldList['stepNumber']['required'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['sort'] = 'no';
+4 -2
View File
@@ -500,7 +500,9 @@ class testcase extends control
$this->view->branchName = $this->session->currentProductType == 'normal' ? '' : $this->loadModel('branch')->getById($case->branch);
}
$caseFails = $this->dao->select('`case` AS name, COUNT(*) AS value')->from(TABLE_TESTRESULT)->where('caseResult')->eq('fail')->andwhere('`case`')->eq($caseID)->groupBy('name')->orderBy('value DESC')->fetchAll('name');
$caseFails = $this->dao->select('COUNT(*) AS count')->from(TABLE_TESTRESULT)->where('caseResult')->eq('fail')->andwhere('`case`')->eq($caseID)
->beginIF($from == 'testtask')->andwhere('`run`')->eq($taskID)->fi()
->fetch('count');
$this->view->position[] = $this->lang->testcase->common;
$this->view->position[] = $this->lang->testcase->view;
@@ -515,7 +517,7 @@ class testcase extends control
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('testcase', $caseID);
$this->view->runID = $from == 'testcase' ? 0 : $run->id;
$this->view->isLibCase = $isLibCase;
$this->view->caseFails = $caseFails ? $caseFails : 0;
$this->view->caseFails = $caseFails;
$this->display();
}
+21
View File
@@ -1286,12 +1286,33 @@ class testcaseModel extends model
if(empty($stories)) $stories = $this->dao->select('id,title')->from(TABLE_STORY)->where('deleted')->eq('0')->andWhere('product')->eq($case->product)->fetchPairs('id', 'title');
if($case->story and isset($stories[$case->story])) echo html::a(helper::createLink('story', 'view', "storyID=$case->story"), $stories[$case->story]);
break;
case 'precondition':
echo $case->precondition;
break;
case 'keywords':
echo $case->keywords;
break;
case 'version':
echo $case->version;
break;
case 'openedBy':
echo zget($users, $case->openedBy, $case->openedBy);
break;
case 'openedDate':
echo substr($case->openedDate, 5, 11);
break;
case 'reviewedBy':
echo zget($users, $case->reviewedBy, $case->reviewedBy);
break;
case 'reviewedDate':
echo substr($case->reviewedDate, 5, 11);
break;
case 'lastEditedBy':
echo zget($users, $case->lastEditedBy, $case->lastEditedBy);
break;
case 'lastEditedDate':
echo substr($case->lastEditedDate, 5, 11);
break;
case 'lastRunner':
echo zget($users, $case->lastRunner, $case->lastRunner);
break;
+29 -4
View File
@@ -43,14 +43,39 @@ js::set('branch', $branch);
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/browsedata.html.php';
$vars = "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
include $file2Include;
if($useDatatable) include '../../common/view/datatable.html.php';
if(!$useDatatable) include '../../common/view/tablesorter.html.php';
$setting = $this->datatable->getSetting('testcase');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='caseList' data-checkable='true' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='caseIDList[]'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns ++;
}
}
?>
</tr>
</thead>
<tbody>
<?php foreach($cases as $case):?>
<tr class='text-center' data-id='<?php echo $case->id?>'>
<?php foreach($setting as $key => $value) $this->testcase->printCell($value, $case, $users, $branches, $modulePairs, $browseType);?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<?php $mergeColums = $browseType == 'needconfirm' ? 5 : 13;?>
<td colspan='<?php echo $mergeColums?>'>
<td colspan='<?php echo $columns?>'>
<?php if($cases):?>
<div class='table-actions clearfix'>
<?php echo html::selectButton();?>
-99
View File
@@ -1,99 +0,0 @@
<?php
/**
* The browse data view file of testcase module of ZenTaoPMS.
*
* @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 testcase
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/tablesorter.html.php';?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed table-selectable' id='caseList'>
<thead>
<tr>
<th class='w-id {sorter:false}'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-pri {sorter:false}'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th class='{sorter:false}'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->testcase->title);?></th>
<?php if($browseType == 'needconfirm'):?>
<th class='{sorter:false}'> <?php common::printOrderLink('story', $orderBy, $vars, $lang->testcase->story);?></th>
<th class='w-50px {sorter:false}'> <?php echo $lang->actions;?></th>
<?php else:?>
<th class='w-type {sorter:false}'> <?php common::printOrderLink('type', $orderBy, $vars, $lang->typeAB);?></th>
<th class='w-user {sorter:false}'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
<th class='w-80px {sorter:false}'> <?php common::printOrderLink('lastRunner', $orderBy, $vars, $lang->testtask->lastRunAccount);?></th>
<th class='w-120px {sorter:false}'> <?php common::printOrderLink('lastRunDate', $orderBy, $vars, $lang->testtask->lastRunTime);?></th>
<th class='w-80px {sorter:false}'> <?php common::printOrderLink('lastRunResult', $orderBy, $vars, $lang->testtask->lastRunResult);?></th>
<th class='w-100px {sorter:false}'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
<th class='w-30px' title='<?php echo $lang->testcase->bugs?>'> <?php echo $lang->testcase->bugsAB;?></th>
<th class='w-30px' title='<?php echo $lang->testcase->results?>'> <?php echo $lang->testcase->resultsAB;?></th>
<th class='w-30px' title='<?php echo $lang->testcase->stepNumber?>'> <?php echo $lang->testcase->stepNumberAB;?></th>
<th class='<?php echo ($config->testcase->needReview or !empty($config->testcase->forceReview)) ? 'w-170px' : 'w-150px'?> {sorter:false}'><?php echo $lang->actions;?></th>
<?php endif;?>
</tr>
</thead>
<?php if($cases):?>
<tbody>
<?php foreach($cases as $case):?>
<tr class='text-center'>
<?php $viewLink = inlink('view', "caseID=$case->id&version=$case->version");?>
<td class='cell-id'>
<input type='checkbox' name='caseIDList[]' value='<?php echo $case->id;?>'/>
<?php echo html::a($viewLink, sprintf('%03d', $case->id));?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $case->pri, $case->pri)?>'><?php echo zget($lang->testcase->priList, $case->pri, $case->pri);?></span></td>
<td class='text-left' title="<?php echo $case->title?>">
<?php if($case->branch) echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>{$branches[$case->branch]}</span> "?>
<?php if($modulePairs and $case->module) echo "<span title='{$lang->testcase->module}' class='label label-info label-badge'>{$modulePairs[$case->module]}</span> "?>
<?php echo html::a($viewLink, $case->title, null, "style='color: $case->color'");?>
</td>
<?php if($browseType == 'needconfirm'):?>
<td class='text-left'><?php echo html::a($this->createLink('story', 'view', "storyID=$case->story"), $case->storyTitle, '_blank');?></td>
<td><?php $lang->testcase->confirmStoryChange = $lang->confirm; common::printIcon('testcase', 'confirmStoryChange', "caseID=$case->id", '', 'list', '', 'hiddenwin');?></td>
<?php else:?>
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
<td><?php echo $users[$case->openedBy];?></td>
<td><?php echo $users[$case->lastRunner];?></td>
<td><?php if(!helper::isZeroDate($case->lastRunDate)) echo date(DT_MONTHTIME1, strtotime($case->lastRunDate));?></td>
<td class='<?php echo $case->lastRunResult;?>'><?php if($case->lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?></td>
<td class='<?php if(isset($run)) echo $run->status;?> testcase-<?php echo $case->status?>'>
<?php
if($case->needconfirm)
{
echo "(<span class='warning'>{$lang->story->changed}</span> ";
echo html::a($this->createLink('testcase', 'confirmStoryChange', "caseID=$case->id"), $lang->confirm, 'hiddenwin');
echo ")";
}
else
{
echo $lang->testcase->statusList[$case->status];
}
?>
</td>
<td><?php echo (common::hasPriv('testcase', 'bugs') and $case->bugs) ? html::a(inlink('bugs', "runID=0&caseID={$case->id}"), $case->bugs, '', "class='iframe'") : $case->bugs;?></td>
<td><?php echo (common::hasPriv('testtask', 'results') and $case->results) ? html::a($this->createLink('testtask', 'results', "runID=0&caseID={$case->id}"), $case->results, '', "class='iframe'") : $case->results;?></td>
<td><?php echo $case->stepNumber;?></td>
<td class='text-right'>
<?php
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $case, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $case, 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'");
if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe');
common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list');
common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'list', 'copy');
if(common::hasPriv('testcase', 'delete', $case))
{
$deleteURL = $this->createLink('testcase', 'delete', "caseID=$case->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"caseList\",confirmDelete)", '<i class="icon-remove"></i>', '', "title='{$lang->testcase->delete}' class='btn-icon'");
}
common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=", $case, 'list', 'bug', '', 'iframe',false,"data-width='95%'");
?>
</td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
<?php endif;?>
@@ -1,29 +0,0 @@
<?php
/**
* The datatable data view file of testcase module of ZenTaoPMS.
*
* @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 testcase
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/datatable.html.php';
$setting = $this->datatable->getSetting('testcase');
$widths = $this->datatable->setFixedFieldWidth($setting);
extract($widths);
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='caseList' data-checkable='true' data-fixed-left-width='<?php echo $leftWidth?>' data-fixed-right-width='<?php echo $rightWidth?>' data-custom-menu='true' data-checkbox-name='caseIDList[]'>
<thead>
<tr><?php foreach($setting as $key => $value) $this->datatable->printHead($value, $orderBy, $vars);?></tr>
</thead>
<tbody>
<?php foreach($cases as $case):?>
<tr class='text-center' data-id='<?php echo $case->id?>'>
<?php foreach($setting as $key => $value) $this->testcase->printCell($value, $case, $users, $branches, $modulePairs, $browseType);?>
</tr>
<?php endforeach;?>
</tbody>
+1 -1
View File
@@ -15,4 +15,4 @@ $config->testtask->editor->block = array('id' => 'comment', 'tools' => 'simple
$config->testtask->editor->activate= array('id' => 'comment', 'tools' => 'simpleTools');
$config->testtask->datatable = new stdclass();
$config->testtask->datatable->defaultField = array('id', 'pri', 'title', 'type', 'assignedTo', 'lastRunner', 'lastRunDate', 'lastRunResult', 'status', 'bugs', 'results', 'actions');
$config->testtask->datatable->defaultField = array('id', 'pri', 'title', 'type', 'assignedTo', 'lastRunner', 'lastRunDate', 'lastRunResult', 'status', 'bugs', 'results', 'stepNumber','actions');
+21
View File
@@ -1158,6 +1158,15 @@ class testtaskModel extends model
case 'status':
echo ($run->version < $run->caseVersion) ? "<span class='warning'>{$this->lang->testcase->changed}</span>" : $this->lang->testtask->statusList[$run->status];
break;
case 'precondition':
echo $run->precondition;
break;
case 'keywords':
echo $run->keywords;
break;
case 'version':
echo $run->version;
break;
case 'openedBy':
$openedBy = zget($users, $run->openedBy, $run->openedBy);
echo substr($openedBy, strpos($openedBy, ':') + 1);
@@ -1165,6 +1174,18 @@ class testtaskModel extends model
case 'openedDate':
echo substr($run->openedDate, 5, 11);
break;
case 'reviewedBy':
echo zget($users, $run->reviewedBy, $run->reviewedBy);
break;
case 'reviewedDate':
echo substr($run->reviewedDate, 5, 11);
break;
case 'lastEditedBy':
echo zget($users, $run->lastEditedBy, $run->lastEditedBy);
break;
case 'lastEditedDate':
echo substr($run->lastEditedDate, 5, 11);
break;
case 'lastRunner':
$lastRunner = zget($users, $run->lastRunner, $run->lastRunner);
echo substr($lastRunner, strpos($lastRunner, ':') + 1);
+33 -3
View File
@@ -37,17 +37,47 @@ var moduleID = '<?php echo $moduleID;?>';
$vars = "taskID=$task->id&browseType=$browseType&param=$param&orderBy=%s&recToal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/casesdata.html.php';
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
$canBatchAssign = common::hasPriv('testtask', 'batchAssign');
$canBatchRun = common::hasPriv('testtask', 'batchRun');
$hasCheckbox = ($canBatchEdit or $canBatchAssign or $canBatchRun);
include $file2Include;
if($useDatatable) include '../../common/view/datatable.html.php';
if(!$useDatatable) include '../../common/view/tablesorter.html.php';
$this->config->testcase->datatable->defaultField = $this->config->testtask->datatable->defaultField;
$this->config->testcase->datatable->fieldList['actions']['width'] = '100';
$setting = $this->datatable->getSetting('testtask');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='caseList' data-checkable='<?php echo $hasCheckbox?>' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='caseIDList[]'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns ++;
}
}
?>
</tr>
</thead>
<tbody>
<?php foreach($runs as $run):?>
<tr class='text-center' data-id='<?php echo $run->case?>'>
<?php foreach($setting as $key => $value) $this->testtask->printCell($value, $run, $users, $task, $branches);?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='13'>
<td colspan='<?php echo $columns?>'>
<?php if($runs):?>
<div class='table-actions clearfix'>
<?php if($hasCheckbox) echo html::selectButton();?>
-79
View File
@@ -1,79 +0,0 @@
<?php
/**
* The cases data view file of testtask module of ZenTaoPMS.
*
* @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 testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/tablesorter.html.php';?>
<?php $vars = "taskID=$task->id&browseType=$browseType&param=$param&orderBy=%s&recToal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed table-selectable' id='caseList'>
<thead>
<tr class='colhead'>
<th class='w-id {sorter: false}'><nobr><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></nobr></th>
<th class='w-pri {sorter: false}'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th class='{sorter: false}'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->testcase->title);?></th>
<th class='w-type {sorter: false}'> <?php common::printOrderLink('type', $orderBy, $vars, $lang->testcase->type);?></th>
<th class='w-user {sorter: false}'> <?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->testtask->assignedTo);?></th>
<th class='w-user {sorter: false}'> <?php common::printOrderLink('lastRunner', $orderBy, $vars, $lang->testtask->lastRunAccount);?></th>
<th class='w-100px {sorter: false}'> <?php common::printOrderLink('lastRunDate', $orderBy, $vars, $lang->testtask->lastRunTime);?></th>
<th class='w-80px {sorter: false}'> <?php common::printOrderLink('lastRunResult', $orderBy, $vars, $lang->testtask->lastRunResult);?></th>
<th class='w-status {sorter: false}'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
<th class='w-30px' title='<?php echo $lang->testcase->bugs?>'> <?php echo $lang->testcase->bugsAB;?></th>
<th class='w-30px' title='<?php echo $lang->testcase->results?>'> <?php echo $lang->testcase->resultsAB;?></th>
<th class='w-30px' title='<?php echo $lang->testcase->stepNumber?>'> <?php echo $lang->testcase->stepNumberAB;?></th>
<th class='w-120px {sorter: false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<?php
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
$canBatchAssign = common::hasPriv('testtask', 'batchAssign');
$canBatchRun = common::hasPriv('testtask', 'batchRun');
?>
<?php if($runs):?>
<tbody>
<?php foreach($runs as $run):?>
<tr class='text-center'>
<td class='cell-id'>
<?php if($canBatchEdit or $canBatchAssign or $canBatchRun):?>
<input type='checkbox' name='caseIDList[]' value='<?php echo $run->case;?>'/>
<?php endif;?>
<?php printf('%03d', $run->case);?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $run->pri, $run->pri)?>'><?php echo zget($lang->testcase->priList, $run->pri, $run->pri)?></span></td>
<td class='text-left nobr'>
<?php if($run->branch) echo "<span class='label label-info label-badge'>{$branches[$run->branch]}</span>"?>
<?php echo html::a($this->createLink('testcase', 'view', "caseID=$run->case&version=$run->version&from=testtask&taskID=$run->task"), $run->title);?>
</td>
<td><?php echo $lang->testcase->typeList[$run->type];?></td>
<td><?php $assignedTo = $users[$run->assignedTo]; echo substr($assignedTo, strpos($assignedTo, ':') + 1);?></td>
<td><?php $lastRunner = $users[$run->lastRunner]; echo substr($lastRunner, strpos($lastRunner, ':') + 1);?></td>
<td><?php if(!helper::isZeroDate($run->lastRunDate)) echo date(DT_MONTHTIME1, strtotime($run->lastRunDate));?></td>
<td class='<?php echo $run->lastRunResult;?>'><?php if($run->lastRunResult) echo $lang->testcase->resultList[$run->lastRunResult];?></td>
<td class='<?php echo $run->status;?>'><?php echo ($run->version < $run->caseVersion) ? "<span class='warning'>{$lang->testcase->changed}</span>" : $lang->testtask->statusList[$run->status];?></td>
<td><?php echo (common::hasPriv('testcase', 'bugs') and $run->bugs) ? html::a($this->createLink('testcase', 'bugs', "runID={$run->id}&caseID={$run->case}"), $run->bugs, '', "class='iframe'") : $run->bugs;?></td>
<td><?php echo (common::hasPriv('testtask', 'results') and $run->results) ? html::a($this->createLink('testtask', 'results', "runID={$run->id}&caseID={$run->case}"), $run->results, '', "class='iframe'") : $run->results;?></td>
<td><?php echo $run->stepNumber;?></td>
<td class='text-center'>
<?php
common::printIcon('testtask', 'runCase', "id=$run->id", $run, 'list', '', '', 'runCase iframe', false, "data-width='95%'");
common::printIcon('testtask', 'results', "id=$run->id", $run, 'list', '', '', 'iframe', '', "data-width='90%'");
if(common::hasPriv('testtask', 'unlinkCase', $run))
{
$unlinkURL = $this->createLink('testtask', 'unlinkCase', "caseID=$run->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"caseList\",confirmUnlink)", '<i class="icon-unlink"></i>', '', "title='{$lang->testtask->unlinkCase}' class='btn-icon'");
}
common::printIcon('testcase', 'createBug', "product=$productID&branch=$task->branch&extra=projectID=$task->project,buildID=$task->build,caseID=$run->case,version=$run->version,runID=$run->id,testtask=$taskID", $run, 'list', 'bug', '', 'iframe', '', "data-width='90%'");
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<?php endif;?>
@@ -1,36 +0,0 @@
<?php
/**
* The datatable data view file of testtask module of ZenTaoPMS.
*
* @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 testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/datatable.html.php';
$this->config->testcase->datatable->defaultField = $this->config->testtask->datatable->defaultField;
$this->config->testcase->datatable->fieldList['assignedTo']['title'] = 'assignedTo';
$this->config->testcase->datatable->fieldList['assignedTo']['fixed'] = 'no';
$this->config->testcase->datatable->fieldList['assignedTo']['width'] = '80';
$this->config->testcase->datatable->fieldList['assignedTo']['required'] = 'no';
$this->config->testcase->datatable->fieldList['actions']['width'] = '100';
$setting = $this->datatable->getSetting('testtask');
$widths = $this->datatable->setFixedFieldWidth($setting);
extract($widths);
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='caseList' data-checkable='<?php echo $hasCheckbox?>' data-fixed-left-width='<?php echo $leftWidth?>' data-fixed-right-width='<?php echo $rightWidth?>' data-custom-menu='true' data-checkbox-name='caseIDList[]'>
<thead>
<tr><?php foreach($setting as $key => $value) $this->datatable->printHead($value, $orderBy, $vars);?></tr>
</thead>
<tbody>
<?php foreach($runs as $run):?>
<tr class='text-center' data-id='<?php echo $run->case?>'>
<?php foreach($setting as $key => $value) $this->testtask->printCell($value, $run, $users, $task, $branches);?>
</tr>
<?php endforeach;?>
</tbody>
+9
View File
@@ -0,0 +1,9 @@
<?php
$config->webhook->create = new stdclass();
$config->webhook->create->requiredFields = 'name, url';
$config->webhook->edit = new stdclass();
$config->webhook->edit->requiredFields = 'name, url';
$config->webhook->requestType['post'] = 'post';
$config->webhook->requestType['get'] = 'get';
+127
View File
@@ -0,0 +1,127 @@
<?php
/**
* The control file of webhook module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package webhook
* @version $Id$
* @link http://www.zentao.net
*/
class webhook extends control
{
/**
* Browse entries.
*
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function browse($orderBy = 'id_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1)
{
$pager = $this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->view->title = $this->lang->webhook->api . $this->lang->colon . $this->lang->webhook->list;
$this->view->entries = $this->webhook->getList($orderBy, $pager);
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->display();
}
/**
* Create an webhook.
*
* @access public
* @return void
*/
public function create()
{
if($_POST)
{
$webhookID = $this->webhook->create();
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('webhook', $webhookID, 'created');
$this->send(array('result' => 'success', 'message' => $this->lang->webhook->saveSuccess, 'locate' => inlink('browse')));
}
$this->view->title = $this->lang->webhook->api . $this->lang->colon . $this->lang->webhook->create;
$this->display();
}
/**
* Edit an webhook.
*
* @param int $webhookID
* @access public
* @return void
*/
public function edit($webhookID)
{
if($_POST)
{
$changes = $this->webhook->update($webhookID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
if($changes)
{
$actionID = $this->loadModel('action')->create('webhook', $webhookID, 'edited');
$this->action->logHistory($actionID, $changes);
}
$this->send(array('result' => 'success', 'message' => $this->lang->webhook->saveSuccess, 'locate' => inlink('browse')));
}
$webhook = $this->webhook->getById($webhookID);
$this->view->title = $this->lang->webhook->edit . $this->lang->colon . $webhook->name;
$this->view->webhook = $webhook;
$this->display();
}
/**
* Delete an webhook.
*
* @param int $webhookID
* @access public
* @return void
*/
public function delete($webhookID)
{
$this->webhook->delete($webhookID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->send(array('result' => 'success'));
}
public function log($webhookID)
{
$webhook = $this->webhook->getById($webhookID);
$this->view->title = $this->lang->webhook->log . $this->lang->colon . $webhook->name;
$this->view->actions = $this->loadModel('action')->getList('webhook', $webhookID);
$this->display();
}
public function actions($webhookID)
{
if($_POST)
{
$this->webhook->saveActions($webhookID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->send(array('result' => 'success', 'message' => $this->lang->webhook->saveSuccess, 'locate' => inlink('browse')));
}
$webhook = $this->webhook->getById($webhookID);
$this->view->title = $this->lang->webhook->actions . $this->lang->colon . $webhook->name;
$this->view->actions = $this->webhook->getActions($webhookID);
$this->display();
}
public function ajaxGetActions($module)
{
}
}
+31
View File
@@ -0,0 +1,31 @@
/**
* create key for an entry.
*
* @access public
* @return void
*/
function createKey()
{
var chars = '0123456789abcdefghiklmnopqrstuvwxyz'.split('');
var key = '';
for(var i = 0; i < 32; i ++)
{
key += chars[Math.floor(Math.random() * chars.length)];
}
$('#key').val(key);
return false;
}
$('#allIP').change(function()
{
if($(this).prop('checked'))
{
$('#ip').attr('disabled', 'disabled');
}
else
{
$('#ip').removeAttr('disabled');
}
})
$('#name').focus();
+31
View File
@@ -0,0 +1,31 @@
/**
* create key for an entry.
*
* @access public
* @return void
*/
function createKey()
{
var chars = '0123456789abcdefghiklmnopqrstuvwxyz'.split('');
var key = '';
for(var i = 0; i < 32; i ++)
{
key += chars[Math.floor(Math.random() * chars.length)];
}
$('#key').val(key);
return false;
}
$('#allIP').change(function()
{
if($(this).prop('checked'))
{
$('#ip').attr('disabled', 'disabled');
}
else
{
$('#ip').removeAttr('disabled');
}
})
$('#name').focus();
+31
View File
@@ -0,0 +1,31 @@
<?php
$lang->webhook->common = 'webhook';
$lang->webhook->list = 'webhook列表';
$lang->webhook->api = '接口';
$lang->webhook->entry = '应用';
$lang->webhook->log = '日志';
$lang->webhook->action = '触发操作';
$lang->webhook->browse = '浏览webhook';
$lang->webhook->create = '添加webhook';
$lang->webhook->edit = '编辑webhook';
$lang->webhook->delete = '删除webhook';
$lang->webhook->id = 'ID';
$lang->webhook->name = '名称';
$lang->webhook->url = '请求地址';
$lang->webhook->requestType = '请求类型';
$lang->webhook->params = '参数';
$lang->webhook->desc = '描述';
$lang->webhook->createdBy = '由谁创建';
$lang->webhook->createdDate = '创建时间';
$lang->webhook->editedby = '最后编辑';
$lang->webhook->editedDate = '编辑时间';
$lang->webhook->saveSuccess = '保存成功';
$lang->webhook->confirmDelete = '您确认要删除该webhook吗?';
$lang->webhook->note = new stdClass();
$lang->webhook->note->name = '授权webhook名称';
$lang->webhook->note->url = '授权webhook地址';
$lang->webhook->note->params = '参数列表,以 & 隔开';
+100
View File
@@ -0,0 +1,100 @@
<?php
/**
* The model file of webhook module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package webhook
* @version $Id$
* @link http://www.zentao.net
*/
class webhookModel extends model
{
/**
* Get an webhook by id.
*
* @param int $webhookID
* @access public
* @return array
*/
public function getById($webhookID)
{
return $this->dao->select('*')->from(TABLE_WEBHOOK)->where('id')->eq($webhookID)->fetch();
}
/**
* Get webhook list.
*
* @param string $orderBy
* @param obejct $pager
* @access public
* @return array
*/
public function getList($orderBy = 'id_desc', $pager = null)
{
return $this->dao->select('*')->from(TABLE_WEBHOOK)->orderBy($orderBy)->page($pager)->fetchAll('id');
}
/**
* Create an webhook.
*
* @access public
* @return bool | int
*/
public function create()
{
$webhook = fixer::input('post')
->add('createdBy', $this->app->user->account)
->add('createdDate', helper::now())
->get();
$this->dao->insert(TABLE_WEBHOOK)->data($webhook)
->batchCheck($this->config->webhook->create->requiredFields, 'notempty')
->autoCheck()
->exec();
if(dao::isError()) return false;
return $this->dao->lastInsertId();
}
/**
* Update an webhook.
*
* @param int $webhookID
* @access public
* @return bool | array
*/
public function update($webhookID)
{
$oldEntry = $this->getById($webhookID);
$webhook = fixer::input('post')
->add('editedBy', $this->app->user->account)
->add('editedDate', helper::now())
->get();
$this->dao->update(TABLE_WEBHOOK)->data($webhook)
->batchCheck($this->config->webhook->edit->requiredFields, 'notempty')
->autoCheck()
->where('id')->eq($webhookID)
->exec();
if(dao::isError()) return false;
return common::createChanges($oldEntry, $webhook);
}
/**
* Delete an webhook.
*
* @param int $webhookID
* @param int $null
* @access public
* @return bool
*/
public function delete($webhookID, $null = null)
{
$this->dao->delete()->from(TABLE_WEBHOOK)->where('id')->eq($webhookID)->exec();
return !dao::isError();
}
}
+60
View File
@@ -0,0 +1,60 @@
<?php
/**
* The browse view file of webhook module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package webhook
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include 'header.html.php';?>
<?php js::set('confirmDelete', $lang->webhook->confirmDelete);?>
<form id='ajaxForm' method='post'>
<table id='webhookList' class='table table-condensed table-hover table-striped tablesorter'>
<thead>
<tr>
<?php $vars = "orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";?>
<th class='w-80px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->webhook->id);?></th>
<th class='w-200px'><?php common::printOrderLink('name', $orderBy, $vars, $lang->webhook->name);?></th>
<th class='w-200px'><?php common::printOrderLink('url', $orderBy, $vars, $lang->webhook->url);?></th>
<th class='w-100px'><?php common::printOrderLink('requestType', $orderBy, $vars, $lang->webhook->requestType);?></th>
<th class='w-200px'><?php common::printOrderLink('params', $orderBy, $vars, $lang->webhook->params);?></th>
<th><?php echo common::printOrderLink('desc', $orderBy, $vars, $lang->webhook->desc);?></th>
<th class='w-100px'><?php echo html::a('###', $lang->actions);?></th>
</tr>
</thead>
<tbody>
<?php foreach($entries as $webhook):?>
<tr>
<td class='text-center'><?php echo $webhook->id;?></td>
<td title='<?php echo $webhook->name;?>'><?php echo $webhook->name;?></td>
<td><?php echo $webhook->url;?></td>
<td title='<?php echo $webhook->requestType;?>'><?php echo $webhook->requestType;?></td>
<td title='<?php echo $webhook->params;?>'><?php echo $webhook->params;?></td>
<td title='<?php echo $webhook->desc;?>'><?php echo $webhook->desc;?></td>
<td class='text-right'>
<?php
common::printIcon('webhook', 'log', "webhookID=$webhook->id", '', 'list', 'file-text-o');
common::printIcon('webhook', 'action', "webhookID=$webhook->id", '', 'list', 'cog');
common::printIcon('webhook', 'edit', "webhookID=$webhook->id", '', 'list');
if(common::hasPriv('webhook', 'delete'))
{
$deleteURL = $this->createLink('webhook', 'delete', "webhookID=$webhook->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"webhookList\",confirmDelete)", '<i class="icon-remove"></i>', '', "title='{$lang->webhook->delete}' class='btn-icon'");
}
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='7'><?php $pager->show();?></td>
</tr>
</tfoot>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>
+55
View File
@@ -0,0 +1,55 @@
<?php
/**
* The create view file of webhook module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package webhook
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/form.html.php';?>
<div class='container mw-800px'>
<div id="titlebar">
<div class="heading">
<strong><?php echo $lang->webhook->api;?></strong>
<small class="text-muted"> <?php echo $lang->webhook->create;?> <i class="icon-pencil"></i></small>
</div>
</div>
<form id='webhookForm' method='post' class='ajaxForm'>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->webhook->name;?></th>
<td><?php echo html::input('name', '', "class='form-control' placeholder='{$lang->webhook->note->name}'");?></td>
<td class='w-120px'></td>
</tr>
<tr>
<th><?php echo $lang->webhook->url;?></th>
<td><?php echo html::input('url', '', "class='form-control' placeholder='{$lang->webhook->note->url}'");?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->webhook->requestType;?></th>
<td><?php echo html::select('requestType', $config->webhook->requestType, '', "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->webhook->params;?></th>
<td><?php echo html::input('params', '', "class='form-control' title='{$lang->webhook->note->params}' placeholder='{$lang->webhook->note->params}'");?></td>
</tr>
<tr>
<th><?php echo $lang->webhook->desc;?></th>
<td><?php echo html::textarea('desc', '', "rows='3' class='form-control'");?></td>
<td></td>
</tr>
<tr>
<th></th>
<td><?php echo html::submitButton();?></td>
<td></td>
</tr>
</table>
</form>
</div>
<?php include '../../common/view/footer.lite.html.php';?>
+55
View File
@@ -0,0 +1,55 @@
<?php
/**
* The edit view file of webhook module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package webhook
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/form.html.php';?>
<div class='container mw-800px'>
<div id="titlebar">
<div class="heading">
<strong><?php echo $lang->webhook->api;?></strong>
<small class="text-muted"> <?php echo $lang->webhook->edit;?> <i class="icon-pencil"></i></small>
</div>
</div>
<form id='webhookForm' method='post' class='ajaxForm'>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->webhook->name;?></th>
<td><?php echo html::input('name', $webhook->name, "class='form-control' placeholder='{$lang->webhook->note->name}'");?></td>
<td class='w-120px'></td>
</tr>
<tr>
<th><?php echo $lang->webhook->url;?></th>
<td><?php echo html::input('url', $webhook->url, "class='form-control' placeholder='{$lang->webhook->note->url}'");?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->webhook->requestType;?></th>
<td><?php echo html::select('requestType', $config->webhook->requestType, $webhook->requestType, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->webhook->params;?></th>
<td><?php echo html::input('params', $webhook->params, "class='form-control' title='{$lang->webhook->note->params}' placeholder='{$lang->webhook->note->params}'");?></td>
</tr>
<tr>
<th><?php echo $lang->webhook->desc;?></th>
<td><?php echo html::textarea('desc', $webhook->desc, "rows='3' class='form-control'");?></td>
<td></td>
</tr>
<tr>
<th></th>
<td><?php echo html::submitButton();?></td>
<td></td>
</tr>
</table>
</form>
</div>
<?php include '../../common/view/footer.lite.html.php';?>
+29
View File
@@ -0,0 +1,29 @@
<?php
/**
* The header view file of webhook module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package webhook
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<div id='featurebar'>
<ul class='nav'>
<?php
echo '<li id="entry">'; common::printLink('entry', 'browse', "", $lang->webhook->entry); echo '</li>';
echo '<li id="webhook">'; common::printLink('webhook', 'browse', "", $lang->webhook->common); echo '</li>';
?>
</ul>
<div class='actions'>
<div class='btn-group'>
<div class='btn-group' id='createActionMenu'>
<?php common::printIcon('webhook', 'create', '', '', 'button', '', '', 'btn-primary');?>
</div>
</div>
</div>
</div>
<script>$('#<?php echo $this->moduleName;?>').addClass('active')</script>