+ Add en lang files.
* Finish task 3292,3293,3294,3305,3306,3307,3308,3309.
This commit is contained in:
+2
-2
@@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS `zt_webhook` (
|
||||
`type` varchar(10) NOT NULL DEFAULT 'default',
|
||||
`name` varchar(50) NOT NULL,
|
||||
`url` varchar(255) NOT NULL,
|
||||
`contentType` enum('json','form') NOT NULL DEFAULT 'json',
|
||||
`contentType` varchar(30) NOT NULL DEFAULT 'application/json',
|
||||
`sendType` enum('sync','async') NOT NULL DEFAULT 'sync',
|
||||
`products` text NOT NULL,
|
||||
`projects` text NOT NULL,
|
||||
@@ -56,7 +56,7 @@ CREATE TABLE IF NOT EXISTS `zt_log` (
|
||||
`action` mediumint(8) unsigned NOT NULL,
|
||||
`date` datetime NOT NULL,
|
||||
`url` varchar(255) NOT NULL,
|
||||
`contentType` varchar(40) NOT NULL,
|
||||
`contentType` varchar(30) NOT NULL,
|
||||
`data` text NOT NULL,
|
||||
`result` text NOT NULL,
|
||||
PRIMARY KEY `id` (`id`),
|
||||
|
||||
@@ -345,7 +345,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->api = array('link' => 'API|webhook|browse', 'alias' => 'create,edit', 'subModule' => 'entry,webhook');
|
||||
$lang->admin->menu->sso = 'RangerTeam|admin|sso';
|
||||
|
||||
$lang->convert = new stdclass();
|
||||
@@ -434,14 +434,14 @@ $lang->error->editedByOther = 'This record might have been changed. Please ref
|
||||
$lang->error->tutorialData = 'No data can be imported in tutorial mode. Please exit tutorial first!';
|
||||
|
||||
$lang->error->entry = array();
|
||||
$lang->error->entry['300001'] = 'Param code not set.';
|
||||
$lang->error->entry['300002'] = 'Param token not set.';
|
||||
$lang->error->entry['310001'] = 'Entry not exist.';
|
||||
$lang->error->entry['310002'] = 'Key of entry not set.';
|
||||
$lang->error->entry['320001'] = 'IP denied.';
|
||||
$lang->error->entry['330001'] = 'Invalid token.';
|
||||
$lang->error->entry['340001'] = 'Session code not set.';
|
||||
$lang->error->entry['340002'] = 'Session verify failed.';
|
||||
$lang->error->entry['301'] = 'Param code not set.';
|
||||
$lang->error->entry['302'] = 'Param token not set.';
|
||||
$lang->error->entry['311'] = 'Entry not exist.';
|
||||
$lang->error->entry['312'] = 'Key of entry not set.';
|
||||
$lang->error->entry['321'] = 'IP denied.';
|
||||
$lang->error->entry['331'] = 'Invalid token.';
|
||||
$lang->error->entry['341'] = 'Session code not set.';
|
||||
$lang->error->entry['342'] = 'Session verify failed.';
|
||||
|
||||
/* 分页信息。*/
|
||||
$lang->pager = new stdclass();
|
||||
|
||||
@@ -40,7 +40,6 @@ $lang->product->menuOrder[40] = 'doc';
|
||||
$lang->product->menuOrder[45] = 'project';
|
||||
$lang->product->menuOrder[50] = 'branch';
|
||||
$lang->product->menuOrder[55] = 'module';
|
||||
$lang->product->menuOrder[57] = 'category';
|
||||
$lang->product->menuOrder[60] = 'view';
|
||||
$lang->product->menuOrder[65] = 'create';
|
||||
$lang->product->menuOrder[70] = 'all';
|
||||
|
||||
@@ -345,7 +345,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->api = array('link' => '接口|webhook|browse', 'alias' => 'create,edit', 'subModule' => 'entry,webhook');
|
||||
$lang->admin->menu->sso = '然之集成|admin|sso';
|
||||
|
||||
$lang->convert = new stdclass();
|
||||
@@ -434,14 +434,14 @@ $lang->error->editedByOther = '该记录可能已经被改动。请刷新页
|
||||
$lang->error->tutorialData = '新手模式下不会插入数据,请退出新手模式操作';
|
||||
|
||||
$lang->error->entry = array();
|
||||
$lang->error->entry['300001'] = '缺少code参数';
|
||||
$lang->error->entry['300002'] = '缺少token参数';
|
||||
$lang->error->entry['310001'] = '应用不存在';
|
||||
$lang->error->entry['310002'] = '应用未设置密钥';
|
||||
$lang->error->entry['320001'] = '该IP访问被限制访问';
|
||||
$lang->error->entry['330001'] = '不合法的token参数';
|
||||
$lang->error->entry['340001'] = '缺少session code';
|
||||
$lang->error->entry['340002'] = 'session验证失败';
|
||||
$lang->error->entry['301'] = '缺少code参数';
|
||||
$lang->error->entry['302'] = '缺少token参数';
|
||||
$lang->error->entry['311'] = '应用不存在';
|
||||
$lang->error->entry['312'] = '应用未设置密钥';
|
||||
$lang->error->entry['321'] = '该IP访问被限制访问';
|
||||
$lang->error->entry['331'] = '不合法的token参数';
|
||||
$lang->error->entry['341'] = '缺少session code';
|
||||
$lang->error->entry['342'] = 'session验证失败';
|
||||
|
||||
/* 分页信息。*/
|
||||
$lang->pager = new stdclass();
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
$lang->entry->common = 'Entry';
|
||||
$lang->entry->list = 'Entry List';
|
||||
$lang->entry->api = 'API';
|
||||
$lang->entry->webhook = 'Webhook';
|
||||
$lang->entry->log = 'Log';
|
||||
|
||||
$lang->entry->browse = 'Browse';
|
||||
$lang->entry->create = 'Create';
|
||||
$lang->entry->edit = 'Edit';
|
||||
$lang->entry->delete = 'Delete';
|
||||
$lang->entry->createKey = 'Regenerate';
|
||||
|
||||
$lang->entry->id = 'ID';
|
||||
$lang->entry->name = 'Name';
|
||||
$lang->entry->code = 'Code';
|
||||
$lang->entry->key = 'Key';
|
||||
$lang->entry->ip = 'IP';
|
||||
$lang->entry->desc = 'Desc';
|
||||
$lang->entry->createdBy = 'Created By';
|
||||
$lang->entry->createdDate = 'Created Date';
|
||||
$lang->entry->editedby = 'Edited By';
|
||||
$lang->entry->editedDate = 'Edited Date';
|
||||
$lang->entry->date = 'Request Time';
|
||||
$lang->entry->url = 'Request URL';
|
||||
|
||||
$lang->entry->saveSuccess = 'Save success.';
|
||||
$lang->entry->confirmDelete = 'Are you sure delete this entry?';
|
||||
$lang->entry->help = 'Help';
|
||||
|
||||
$lang->entry->note = new stdClass();
|
||||
$lang->entry->note->name = 'Name';
|
||||
$lang->entry->note->code = 'Code, should be english and number.';
|
||||
$lang->entry->note->ip = "Use comma between two IPs. IP segment is supported, e.g. 192.168.1.*";
|
||||
$lang->entry->note->allIP = 'All';
|
||||
@@ -3,7 +3,6 @@ $lang->entry->common = '应用';
|
||||
$lang->entry->list = '应用列表';
|
||||
$lang->entry->api = '接口';
|
||||
$lang->entry->webhook = 'webhook';
|
||||
$lang->entry->dingding = '钉钉';
|
||||
$lang->entry->log = '日志';
|
||||
|
||||
$lang->entry->browse = '浏览应用';
|
||||
@@ -25,7 +24,6 @@ $lang->entry->editedDate = '编辑时间';
|
||||
$lang->entry->date = '请求时间';
|
||||
$lang->entry->url = '请求地址';
|
||||
|
||||
$lang->entry->apiIndex = '应用入口';
|
||||
$lang->entry->saveSuccess = '保存成功';
|
||||
$lang->entry->confirmDelete = '您确认要删除该应用吗?';
|
||||
$lang->entry->help = '使用说明';
|
||||
|
||||
+17
-14
@@ -231,7 +231,7 @@ class product extends control
|
||||
$this->view->poUsers = $this->loadModel('user')->getPairs('nodeleted|pofirst|noclosed');
|
||||
$this->view->qdUsers = $this->loadModel('user')->getPairs('nodeleted|qdfirst|noclosed');
|
||||
$this->view->rdUsers = $this->loadModel('user')->getPairs('nodeleted|devfirst|noclosed');
|
||||
$this->view->categories = $this->loadModel('tree')->getOptionMenu($rootID = 0, $type = 'category');
|
||||
$this->view->lines = array('') + $this->loadModel('tree')->getLinePairs();
|
||||
|
||||
unset($this->lang->product->typeList['']);
|
||||
$this->display();
|
||||
@@ -276,7 +276,7 @@ class product extends control
|
||||
$this->view->poUsers = $this->loadModel('user')->getPairs('nodeleted|pofirst', $product->PO);
|
||||
$this->view->qdUsers = $this->loadModel('user')->getPairs('nodeleted|qdfirst', $product->QD);
|
||||
$this->view->rdUsers = $this->loadModel('user')->getPairs('nodeleted|devfirst', $product->RD);
|
||||
$this->view->categories = $this->loadModel('tree')->getOptionMenu($rootID = 0, $type = 'category');
|
||||
$this->view->lines = array('') + $this->loadModel('tree')->getLinePairs();
|
||||
|
||||
unset($this->lang->product->typeList['']);
|
||||
$this->display();
|
||||
@@ -394,7 +394,7 @@ class product extends control
|
||||
$this->view->actions = $this->loadModel('action')->getList('product', $productID);
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->categories = $this->loadModel('tree')->getOptionMenu($rootID = 0, $type = 'category');
|
||||
$this->view->lines = array('') + $this->loadModel('tree')->getLinePairs();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -586,20 +586,22 @@ class product extends control
|
||||
|
||||
foreach($products as $key => $product) $product->key = $productsPinyin[$product->name];
|
||||
|
||||
/* Sort products as categories' order first. */
|
||||
$categories = $this->loadModel('tree')->getOptionMenu($rootID = 0, $type = 'category');
|
||||
/* Sort products as lines' order first. */
|
||||
$lines = $this->loadModel('tree')->getLinePairs();
|
||||
$productList = array();
|
||||
foreach($categories as $id => $category)
|
||||
foreach($lines as $id => $name)
|
||||
{
|
||||
foreach($products as $product)
|
||||
foreach($products as $key => $product)
|
||||
{
|
||||
if($product->category == $id)
|
||||
if($product->line == $id)
|
||||
{
|
||||
$product->name = ltrim($category. '/' . $product->name, '/');
|
||||
$product->name = $name . '/' . $product->name;
|
||||
$productList[] = $product;
|
||||
unset($products[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$productList = array_merge($productList, $products);
|
||||
|
||||
$this->view->products = $productList;
|
||||
$this->display();
|
||||
@@ -648,7 +650,7 @@ class product extends control
|
||||
* All product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $category
|
||||
* @param int $line
|
||||
* @param string $status
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
@@ -657,7 +659,7 @@ class product extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function all($productID = 0, $category = 0, $status = 'noclosed', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1)
|
||||
public function all($productID = 0, $line = 0, $status = 'noclosed', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1)
|
||||
{
|
||||
$this->session->set('productList', $this->app->getURI(true));
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
@@ -670,10 +672,11 @@ class product extends control
|
||||
$this->app->loadLang('my');
|
||||
$this->view->title = $this->lang->product->allProduct;
|
||||
$this->view->position[] = $this->lang->product->allProduct;
|
||||
$this->view->productStats = $this->product->getStats($orderBy, $pager, $status, $category);
|
||||
$this->view->categoryTree = $this->loadModel('tree')->getTreeMenu(0, $viewType = 'category', $startModuleID = 0, array('treeModel', 'createCategoryLink'), array('productID' => $productID, 'status' => $status));
|
||||
$this->view->productStats = $this->product->getStats($orderBy, $pager, $status, $line);
|
||||
$this->view->lineTree = $this->loadModel('tree')->getTreeMenu(0, $viewType = 'line', $startModuleID = 0, array('treeModel', 'createLineLink'), array('productID' => $productID, 'status' => $status));
|
||||
$this->view->lines = array('') + $this->tree->getLinePairs();
|
||||
$this->view->productID = $productID;
|
||||
$this->view->category = $category;
|
||||
$this->view->line = $line;
|
||||
$this->view->status = $status;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
|
||||
@@ -55,8 +55,10 @@ $lang->product->confirmDelete = " Do you want to delete {$lang->productCommon}
|
||||
$lang->product->errorNoProduct = "{$lang->productCommon} is not created yet!";
|
||||
$lang->product->accessDenied = "You have no access to {$lang->productCommon}.";
|
||||
|
||||
$lang->product->id = 'ID';
|
||||
$lang->product->name = "{$lang->productCommon} Name";
|
||||
$lang->product->code = "{$lang->productCommon} Code";
|
||||
$lang->product->line = 'Product Line';
|
||||
$lang->product->order = 'Sort';
|
||||
$lang->product->type = "{$lang->productCommon} Type";
|
||||
$lang->product->status = 'Status';
|
||||
|
||||
@@ -58,7 +58,7 @@ $lang->product->accessDenied = "您无权访问该{$lang->productCommon}";
|
||||
$lang->product->id = "编号";
|
||||
$lang->product->name = "{$lang->productCommon}名称";
|
||||
$lang->product->code = "{$lang->productCommon}代号";
|
||||
$lang->product->category = "{$lang->productCommon}目录";
|
||||
$lang->product->line = '产品线';
|
||||
$lang->product->order = '排序';
|
||||
$lang->product->type = "{$lang->productCommon}类型";
|
||||
$lang->product->status = '状态';
|
||||
|
||||
@@ -203,15 +203,15 @@ class productModel extends model
|
||||
*
|
||||
* @param string $status
|
||||
* @param int $limit
|
||||
* @param int $category
|
||||
* @param int $line
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($status = 'all', $limit = 0, $category = 0)
|
||||
public function getList($status = 'all', $limit = 0, $line = 0)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_PRODUCT)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($category > 0)->andWhere('category')->eq($category)->fi()
|
||||
->beginIF($line > 0)->andWhere('line')->eq($line)->fi()
|
||||
->beginIF($status == 'noclosed')->andWhere('status')->ne('closed')->fi()
|
||||
->beginIF($status != 'all' and $status != 'noclosed' and $status != 'involved')->andWhere('status')->in($status)->fi()
|
||||
->beginIF($status == 'involved')
|
||||
@@ -670,17 +670,17 @@ class productModel extends model
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @param string $status
|
||||
* @param int $category
|
||||
* @param int $line
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getStats($orderBy = 'order_desc', $pager = null, $status = 'noclosed', $category = 0)
|
||||
public function getStats($orderBy = 'order_desc', $pager = null, $status = 'noclosed', $line = 0)
|
||||
{
|
||||
$this->loadModel('report');
|
||||
$this->loadModel('story');
|
||||
$this->loadModel('bug');
|
||||
|
||||
$products = $this->getList($status, $limit = 0, $category);
|
||||
$products = $this->getList($status, $limit = 0, $line);
|
||||
foreach($products as $productID => $product)
|
||||
{
|
||||
if(!$this->checkPriv($product)) unset($products[$productID]);
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
<?php echo html::a($this->createLink('product', 'create'), "<i class='icon-plus'></i> " . $lang->product->create,'', "class='btn'") ?>
|
||||
</div>
|
||||
<ul class='nav'>
|
||||
<?php echo "<li id='noclosedTab'>" . html::a(inlink("all", "productID=$productID&category=&status=noclosed"), $lang->product->unclosed) . '</li>';?>
|
||||
<?php echo "<li id='closedTab'>" . html::a(inlink("all", "productID=$productID&category=&status=closed"), $lang->product->statusList['closed']) . '</li>';?>
|
||||
<?php echo "<li id='allTab'>" . html::a(inlink("all", "productID=$productID&category=&status=all"), $lang->product->allProduct) . '</li>';?>
|
||||
<?php echo "<li id='noclosedTab'>" . html::a(inlink("all", "productID=$productID&line=&status=noclosed"), $lang->product->unclosed) . '</li>';?>
|
||||
<?php echo "<li id='closedTab'>" . html::a(inlink("all", "productID=$productID&line=&status=closed"), $lang->product->statusList['closed']) . '</li>';?>
|
||||
<?php echo "<li id='allTab'>" . html::a(inlink("all", "productID=$productID&line=&status=all"), $lang->product->allProduct) . '</li>';?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
<a class='side-handle' data-id='productTree'><i class='icon-caret-left'></i></a>
|
||||
<div class='side-body'>
|
||||
<div class='panel panel-sm'>
|
||||
<div class='panel-heading nobr'><?php echo html::icon($lang->icons['product']);?> <strong><?php echo $lang->product->category;?></strong></div>
|
||||
<div class='panel-heading nobr'><?php echo html::icon($lang->icons['product']);?> <strong><?php echo $lang->product->line;?></strong></div>
|
||||
<div class='panel-body'>
|
||||
<?php echo $categoryTree;?>
|
||||
<?php echo $lineTree;?>
|
||||
<div class='text-right'>
|
||||
<?php common::printLink('tree', 'browse', "rootID=&view=category", $lang->tree->manageCategory);?>
|
||||
<?php common::printLink('tree', 'browse', "rootID=&view=line", $lang->tree->manageLine);?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,11 +58,12 @@
|
||||
<?php $canOrder = (common::hasPriv('product', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
|
||||
<form method='post' action='<?php echo inLink('batchEdit', "productID=$productID");?>' id='productsForm'>
|
||||
<table class='table table-condensed table-hover table-striped tablesorter table-datatable table-selectable' id='productList'>
|
||||
<?php $vars = "category=$category&productID=$productID&status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
|
||||
<?php $vars = "line=$line&productID=$productID&status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='w-id'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->product->name);?></th>
|
||||
<th class='w-80px text-left'><?php common::printOrderLink('line', $orderBy, $vars, $lang->product->line);?></th>
|
||||
<th class='w-80px'><?php echo $lang->product->activeStories;?></th>
|
||||
<th class='w-80px'><?php echo $lang->product->changedStories;?></th>
|
||||
<th class='w-80px'><?php echo $lang->product->draftStories;?></th>
|
||||
@@ -88,6 +89,7 @@
|
||||
<?php echo html::a($this->createLink('product', 'view', 'product=' . $product->id), sprintf('%03d', $product->id));?>
|
||||
</td>
|
||||
<td class='text-left' title='<?php echo $product->name?>'><?php echo html::a($this->createLink('product', 'view', 'product=' . $product->id), $product->name);?></td>
|
||||
<td class='text-left'><?php echo zget($lines, $product->line);?></td>
|
||||
<td><?php echo $product->stories['active']?></td>
|
||||
<td><?php echo $product->stories['changed']?></td>
|
||||
<td><?php echo $product->stories['draft']?></td>
|
||||
@@ -111,7 +113,7 @@
|
||||
<?php echo html::selectButton();?>
|
||||
<?php echo html::submitButton($lang->product->batchEdit);?>
|
||||
<?php endif;?>
|
||||
<?php if(!$canOrder and common::hasPriv('product', 'updateOrder')) echo html::a(inlink('all', "productID=$productID&category=$category&status=$status&order=order_desc&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"), $lang->product->updateOrder, '' , "class='btn'");?>
|
||||
<?php if(!$canOrder and common::hasPriv('product', 'updateOrder')) echo html::a(inlink('all', "productID=$productID&line=$line&status=$status&order=order_desc&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"), $lang->product->updateOrder, '' , "class='btn'");?>
|
||||
</div>
|
||||
<?php $pager->show();?>
|
||||
</td>
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
<td><?php echo html::input('code', '', "class='form-control' autocomplete='off'");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->category;?></th>
|
||||
<td><?php echo html::select('category', $categories, '', "class='form-control chosen'");?></td>
|
||||
<td><?php if(!$categories) common::printLink('tree', 'browse', "rootID=&view=category", $lang->tree->manageCategory);?></td>
|
||||
<th><?php echo $lang->product->line;?></th>
|
||||
<td><?php echo html::select('line', $lines, '', "class='form-control chosen'");?></td>
|
||||
<td><?php if(!$lines) common::printLink('tree', 'browse', "rootID=&view=line", $lang->tree->manageLine);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->PO;?></th>
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
<td><?php echo html::input('code', $product->code, "class='form-control' autocomplete='off'");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->category;?></th>
|
||||
<td><?php echo html::select('category', $categories, $product->category, "class='form-control chosen'");?></td>
|
||||
<td><?php if(!$categories) common::printLink('tree', 'browse', 'rootID=&view=category', $lang->tree->manageCategory);?></td>
|
||||
<th><?php echo $lang->product->line;?></th>
|
||||
<td><?php echo html::select('line', $lines, $product->line, "class='form-control chosen'");?></td>
|
||||
<td><?php if(!$lines) common::printLink('tree', 'browse', 'rootID=&view=line', $lang->tree->manageLine);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->PO;?></th>
|
||||
|
||||
@@ -70,8 +70,8 @@
|
||||
<td><?php echo $product->code;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->category;?></th>
|
||||
<td><?php echo zget($categories, $product->category);?></td>
|
||||
<th><?php echo $lang->product->line;?></th>
|
||||
<td><?php echo zget($lines, $product->line);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->PO;?></th>
|
||||
|
||||
@@ -25,7 +25,7 @@ class tree extends control
|
||||
public function browse($rootID, $viewType, $currentModuleID = 0, $branch = 0)
|
||||
{
|
||||
/* According to the type, set the module root and modules. */
|
||||
if(strpos('story|bug|case|category', $viewType) !== false)
|
||||
if(strpos('story|bug|case|line', $viewType) !== false)
|
||||
{
|
||||
$product = $this->loadModel('product')->getById($rootID);
|
||||
if(!empty($product->type) && $product->type != 'normal')
|
||||
@@ -122,10 +122,10 @@ class tree extends control
|
||||
$position[] = html::a($this->createLink('doc', 'browse', "libID=$rootID"), $lib->name);
|
||||
$position[] = $this->lang->tree->manageCustomDoc;
|
||||
}
|
||||
elseif($viewType == 'category')
|
||||
elseif($viewType == 'line')
|
||||
{
|
||||
$this->lang->set('menugroup.tree', 'product');
|
||||
$this->product->setMenu($this->product->getPairs(), $rootID, $branch, 'category', '', 'category');
|
||||
$this->product->setMenu($this->product->getPairs(), $rootID, $branch, 'line', '', 'line');
|
||||
$this->lang->tree->menu = $this->lang->product->menu;
|
||||
$this->lang->tree->menuOrder = $this->lang->product->menuOrder;
|
||||
|
||||
@@ -135,10 +135,10 @@ class tree extends control
|
||||
|
||||
$this->view->allProduct = $products;
|
||||
$this->view->currentProduct = $currentProduct;
|
||||
$this->view->productModules = $this->tree->getOptionMenu($currentProduct, 'category');
|
||||
$this->view->productModules = $this->tree->getOptionMenu($currentProduct, 'line');
|
||||
|
||||
$title = $this->lang->product->common . $this->lang->colon . $this->lang->tree->manageCategory;
|
||||
$position[] = $this->lang->tree->manageCategory;
|
||||
$title = $this->lang->product->common . $this->lang->colon . $this->lang->tree->manageLine;
|
||||
$position[] = $this->lang->tree->manageLine;
|
||||
}
|
||||
|
||||
$parentModules = $this->tree->getParents($currentModuleID);
|
||||
|
||||
@@ -19,6 +19,7 @@ $lang->tree->manage = 'Manage Module';
|
||||
$lang->tree->fix = 'Fix';
|
||||
$lang->tree->manageProduct = "Manage {$lang->productCommon}";
|
||||
$lang->tree->manageProject = "Manage {$lang->projectCommon}";
|
||||
$lang->tree->manageLine = 'Manage Product Line';
|
||||
$lang->tree->manageBug = 'Manage Bug';
|
||||
$lang->tree->manageCase = 'Manage Case';
|
||||
$lang->tree->manageCaseLib = 'Manage Library';
|
||||
@@ -26,6 +27,7 @@ $lang->tree->manageCustomDoc = 'Manage DocLib';
|
||||
$lang->tree->updateOrder = 'Update Order';
|
||||
$lang->tree->manageChild = 'Manage Child Module';
|
||||
$lang->tree->manageStoryChild = 'Manage Child Story';
|
||||
$lang->tree->manageLineChild = 'Manage Product Line';
|
||||
$lang->tree->manageBugChild = 'Manage Child Bug';
|
||||
$lang->tree->manageCaseChild = 'Manage Child Case';
|
||||
$lang->tree->manageCaselibChild = 'Manage Child Library';
|
||||
@@ -42,12 +44,14 @@ $lang->tree->successFixed = 'Fixed.';
|
||||
$lang->tree->repeatName = 'The name "%s" has existed!';
|
||||
|
||||
$lang->tree->name = 'Name';
|
||||
$lang->tree->line = 'Product Line';
|
||||
$lang->tree->root = 'Root';
|
||||
$lang->tree->branch = 'Platform/Branch';
|
||||
$lang->tree->path = 'Path';
|
||||
$lang->tree->type = 'Type';
|
||||
$lang->tree->parent = 'Parent';
|
||||
$lang->tree->child = 'Child';
|
||||
$lang->tree->lineChild = 'Child';
|
||||
$lang->tree->owner = 'Owner';
|
||||
$lang->tree->order = 'Order';
|
||||
$lang->tree->short = 'Sort';
|
||||
|
||||
+41
-41
@@ -10,32 +10,32 @@
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->tree = new stdclass();
|
||||
$lang->tree->common = '模块维护';
|
||||
$lang->tree->edit = '编辑';
|
||||
$lang->tree->delete = '删除模块';
|
||||
$lang->tree->browse = '通用模块维护';
|
||||
$lang->tree->browseTask = '任务模块维护';
|
||||
$lang->tree->manage = '维护模块';
|
||||
$lang->tree->fix = '修正数据';
|
||||
$lang->tree->manageProduct = "维护{$lang->productCommon}视图模块";
|
||||
$lang->tree->manageProject = "维护{$lang->projectCommon}视图模块";
|
||||
$lang->tree->manageCategory = '维护目录';
|
||||
$lang->tree->manageBug = '维护测试视图模块';
|
||||
$lang->tree->manageCase = '维护用例视图模块';
|
||||
$lang->tree->manageCaseLib = '维护测试库模块';
|
||||
$lang->tree->manageCustomDoc = '维护文档库分类';
|
||||
$lang->tree->updateOrder = '更新排序';
|
||||
$lang->tree->manageChild = '维护子模块';
|
||||
$lang->tree->manageStoryChild = '维护子模块';
|
||||
$lang->tree->manageCategoryChild = '维护子目录';
|
||||
$lang->tree->manageBugChild = '维护Bug子模块';
|
||||
$lang->tree->manageCaseChild = '维护用例子模块';
|
||||
$lang->tree->manageCaselibChild = '维护测试库子模块';
|
||||
$lang->tree->manageTaskChild = "维护{$lang->projectCommon}子模块";
|
||||
$lang->tree->syncFromProduct = '复制';
|
||||
$lang->tree->dragAndSort = "拖放排序";
|
||||
$lang->tree->sort = "排序";
|
||||
$lang->tree->addChild = "增加子模块";
|
||||
$lang->tree->common = '模块维护';
|
||||
$lang->tree->edit = '编辑';
|
||||
$lang->tree->delete = '删除模块';
|
||||
$lang->tree->browse = '通用模块维护';
|
||||
$lang->tree->browseTask = '任务模块维护';
|
||||
$lang->tree->manage = '维护模块';
|
||||
$lang->tree->fix = '修正数据';
|
||||
$lang->tree->manageProduct = "维护{$lang->productCommon}视图模块";
|
||||
$lang->tree->manageProject = "维护{$lang->projectCommon}视图模块";
|
||||
$lang->tree->manageLine = '维护产品线';
|
||||
$lang->tree->manageBug = '维护测试视图模块';
|
||||
$lang->tree->manageCase = '维护用例视图模块';
|
||||
$lang->tree->manageCaseLib = '维护测试库模块';
|
||||
$lang->tree->manageCustomDoc = '维护文档库分类';
|
||||
$lang->tree->updateOrder = '更新排序';
|
||||
$lang->tree->manageChild = '维护子模块';
|
||||
$lang->tree->manageStoryChild = '维护子模块';
|
||||
$lang->tree->manageLineChild = '维护产品线';
|
||||
$lang->tree->manageBugChild = '维护Bug子模块';
|
||||
$lang->tree->manageCaseChild = '维护用例子模块';
|
||||
$lang->tree->manageCaselibChild = '维护测试库子模块';
|
||||
$lang->tree->manageTaskChild = "维护{$lang->projectCommon}子模块";
|
||||
$lang->tree->syncFromProduct = '复制';
|
||||
$lang->tree->dragAndSort = "拖放排序";
|
||||
$lang->tree->sort = "排序";
|
||||
$lang->tree->addChild = "增加子模块";
|
||||
|
||||
$lang->tree->confirmDelete = '该模块及其子模块都会被删除,您确定删除吗?';
|
||||
$lang->tree->confirmRoot = "模块的所属{$lang->productCommon}修改,会关联修改该模块下的需求、Bug、用例的所属{$lang->productCommon},以及{$lang->projectCommon}和{$lang->productCommon}的关联关系。该操作比较危险,请谨慎操作。是否确认修改?";
|
||||
@@ -43,18 +43,18 @@ $lang->tree->successSave = '成功保存';
|
||||
$lang->tree->successFixed = '成功修正数据!';
|
||||
$lang->tree->repeatName = '模块名“%s”已经存在!';
|
||||
|
||||
$lang->tree->name = '模块名称';
|
||||
$lang->tree->category = '目录名称';
|
||||
$lang->tree->root = '所属根';
|
||||
$lang->tree->branch = '平台/分支';
|
||||
$lang->tree->path = '路径';
|
||||
$lang->tree->type = '类型';
|
||||
$lang->tree->parent = '上级模块';
|
||||
$lang->tree->child = '子模块';
|
||||
$lang->tree->categoryChild = '子目录';
|
||||
$lang->tree->owner = '负责人';
|
||||
$lang->tree->order = '排序';
|
||||
$lang->tree->short = '简称';
|
||||
$lang->tree->all = '所有模块';
|
||||
$lang->tree->projectDoc = "{$lang->projectCommon}文档";
|
||||
$lang->tree->product = "所属{$lang->productCommon}";
|
||||
$lang->tree->name = '模块名称';
|
||||
$lang->tree->line = '产品线名称';
|
||||
$lang->tree->root = '所属根';
|
||||
$lang->tree->branch = '平台/分支';
|
||||
$lang->tree->path = '路径';
|
||||
$lang->tree->type = '类型';
|
||||
$lang->tree->parent = '上级模块';
|
||||
$lang->tree->child = '子模块';
|
||||
$lang->tree->lineChild = '子产品线';
|
||||
$lang->tree->owner = '负责人';
|
||||
$lang->tree->order = '排序';
|
||||
$lang->tree->short = '简称';
|
||||
$lang->tree->all = '所有模块';
|
||||
$lang->tree->projectDoc = "{$lang->projectCommon}文档";
|
||||
$lang->tree->product = "所属{$lang->productCommon}";
|
||||
|
||||
+13
-8
@@ -81,7 +81,7 @@ class treeModel extends model
|
||||
*/
|
||||
public function getOptionMenu($rootID, $type = 'story', $startModule = 0, $branch = 0)
|
||||
{
|
||||
if($type == 'category') $rootID = 0;
|
||||
if($type == 'line') $rootID = 0;
|
||||
|
||||
$branches = array($branch => '');
|
||||
if(strpos('story|bug|case', $type) !== false)
|
||||
@@ -170,6 +170,11 @@ class treeModel extends model
|
||||
return $modulePairs;
|
||||
}
|
||||
|
||||
public function getLinePairs()
|
||||
{
|
||||
return $this->dao->select('id, name')->from(TABLE_MODULE)->where('type')->eq('line')->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an option menu of task in html.
|
||||
*
|
||||
@@ -314,7 +319,7 @@ class treeModel extends model
|
||||
*/
|
||||
public function getTreeMenu($rootID, $type = 'root', $startModule = 0, $userFunc, $extra = '', $branch = 0)
|
||||
{
|
||||
if($type == 'category') $rootID = 0;
|
||||
if($type == 'line') $rootID = 0;
|
||||
|
||||
$branches = array($branch => '');
|
||||
if($branch)
|
||||
@@ -763,7 +768,7 @@ class treeModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Create link of a product.
|
||||
* Create link of a product line.
|
||||
*
|
||||
* @param string $type
|
||||
* @param object $module
|
||||
@@ -771,11 +776,11 @@ class treeModel extends model
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function createCategoryLink($type, $module, $extra)
|
||||
public function createLineLink($type, $module, $extra)
|
||||
{
|
||||
$productID = $extra['productID'];
|
||||
$status = $extra['status'];
|
||||
return html::a(helper::createLink('product', 'all', "productID={$productID}&category={$module->id}&status={$status}"), $module->name, '_self', "id='module{$module->id}'");
|
||||
return html::a(helper::createLink('product', 'all', "productID={$productID}&line={$module->id}&status={$status}"), $module->name, '_self', "id='module{$module->id}'");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -959,7 +964,7 @@ class treeModel extends model
|
||||
*/
|
||||
public function getSons($rootID, $moduleID, $type = 'root', $branch = 0)
|
||||
{
|
||||
if($type == 'category') $rootID = 0;
|
||||
if($type == 'line') $rootID = 0;
|
||||
|
||||
/* if createVersion <= 4.1 or type == 'story', only get modules of its type. */
|
||||
if(!$this->isMergeModule($rootID, $type) or $type == 'story')
|
||||
@@ -1205,7 +1210,7 @@ class treeModel extends model
|
||||
*/
|
||||
public function manageChild($rootID, $type, $parentModuleID, $childs)
|
||||
{
|
||||
if($type == 'category') $rootID = 0;
|
||||
if($type == 'line') $rootID = 0;
|
||||
|
||||
$this->checkUnique($rootID, $type, $parentModuleID, $childs);
|
||||
$parentModule = $this->getByID($parentModuleID);
|
||||
@@ -1513,7 +1518,7 @@ class treeModel extends model
|
||||
*/
|
||||
public function getProductStructure($rootID, $viewType, $branch = 0, $currentModuleID = 0)
|
||||
{
|
||||
if($viewType == 'category') $rootID = 0;
|
||||
if($viewType == 'line') $rootID = 0;
|
||||
|
||||
$branches = array($branch => '');
|
||||
$product = $this->loadModel('product')->getById($rootID);
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('viewType', $viewType);?>
|
||||
<?php $hasBranch = (strpos('story|bug|case', $viewType) !== false and (!empty($root->type) && $root->type != 'normal')) ? true : false;?>
|
||||
<?php $name = $viewType == 'category' ? $lang->tree->category : $lang->tree->name;?>
|
||||
<?php $name = $viewType == 'line' ? $lang->tree->line : $lang->tree->name;?>
|
||||
<div id='featurebar'>
|
||||
<div class='heading'><?php echo $viewType == 'category' ? $lang->tree->manageCategory : $lang->tree->common;?></div>
|
||||
<div class='heading'><?php echo $viewType == 'line' ? $lang->tree->manageLine : $lang->tree->common;?></div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-sm-4'>
|
||||
@@ -42,7 +42,7 @@
|
||||
<div class='panel-body'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<?php if($viewType != 'category'):?>
|
||||
<?php if($viewType != 'line'):?>
|
||||
<td class='parentModule'>
|
||||
<nobr>
|
||||
<?php
|
||||
@@ -107,7 +107,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php if($viewType != 'category'):?>
|
||||
<?php if($viewType != 'line'):?>
|
||||
<td></td>
|
||||
<?php endif;?>
|
||||
<td colspan='2'>
|
||||
@@ -181,8 +181,8 @@ $(function()
|
||||
subModules:
|
||||
{
|
||||
linkTemplate: '<?php echo helper::createLink('tree', 'browse', "rootID=$rootID&viewType=$viewType&moduleID={0}&branch={1}"); ?>',
|
||||
title: '<?php echo $viewType == 'category' ? '': $lang->tree->child ?>',
|
||||
template: '<a href="javascript:;"><?php echo $viewType == 'category' ? '': $lang->tree->child?></a>'
|
||||
title: '<?php echo $viewType == 'line' ? '': $lang->tree->child ?>',
|
||||
template: '<a href="javascript:;"><?php echo $viewType == 'line' ? '': $lang->tree->child?></a>'
|
||||
}
|
||||
},
|
||||
action: function(event)
|
||||
@@ -246,7 +246,7 @@ $(function()
|
||||
$tree.find('[data-toggle="tooltip"]').tooltip();
|
||||
|
||||
$('#modulemenu > .nav > li > a[href*=tree][href*=browse]').not('[href*=<?php echo $viewType;?>]').parent().removeClass('active');
|
||||
if(viewType == 'category') $('#modulemenu > .nav > li > a[href*=product][href*=all]').parent('li[data-id=all]').addClass('active');
|
||||
if(viewType == 'line') $('#modulemenu > .nav > li > a[href*=product][href*=all]').parent('li[data-id=all]').addClass('active');
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
|
||||
@@ -5,9 +5,6 @@ $config->webhook->create->requiredFields = 'name, url';
|
||||
$config->webhook->edit = new stdclass();
|
||||
$config->webhook->edit->requiredFields = 'name, url';
|
||||
|
||||
$config->webhook->contentTypes['json'] = 'application/json';
|
||||
$config->webhook->contentTypes['form'] = 'application/x-www-form-urlencoded';
|
||||
|
||||
$config->webhook->objectTypes['product'] = array('opened', 'edited', 'closed', 'undeleted');
|
||||
$config->webhook->objectTypes['story'] = array('opened', 'edited', 'commented', 'frombug', 'changed', 'reviewed', 'closed', 'activated');
|
||||
$config->webhook->objectTypes['productplan'] = array('opened', 'edited');
|
||||
|
||||
@@ -151,9 +151,8 @@ class webhook extends control
|
||||
$webhook = zget($webhooks, $data->webhook, '');
|
||||
if($webhook)
|
||||
{
|
||||
$contentType = zget($this->config->webhook->contentTypes, $webhook->contentType, 'application/json');
|
||||
$result = $this->webhook->fetchHook($contentType, $webhook->url, $data->data);
|
||||
$this->webhook->saveLog($data->webhook, $data->action, $webhook->url, $contentType, $data->data, $result);
|
||||
$result = $this->webhook->fetchHook($webhook, $data->data);
|
||||
$this->webhook->saveLog($webhook, $data->action, $data->data, $result);
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_WEBHOOKDATAS)->set('status')->eq('sended')->where('id')->eq($data->id)->exec();
|
||||
|
||||
@@ -3,7 +3,6 @@ $(function()
|
||||
$('#type').change(function()
|
||||
{
|
||||
var type = $(this).val();
|
||||
$('#contentTypeTR').toggle(type != 'dingding');
|
||||
$('#sendTypeTR').toggle(type != 'dingding');
|
||||
$('#paramsTR').toggle(type != 'bearychat' && type != 'dingding');
|
||||
$('#urlNote').html(urlNote[type]);
|
||||
@@ -21,6 +20,18 @@ $(function()
|
||||
}
|
||||
});
|
||||
|
||||
$('#allParams, #allActions').click(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$(this).parents('tr').find('input[type=checkbox]').attr('checked', 'checked');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).parents('tr').find('input[type=checkbox]').removeAttr('checked');
|
||||
}
|
||||
});
|
||||
|
||||
$('#name').focus();
|
||||
$('#paramstext').attr('disabled', 'disabled');
|
||||
});
|
||||
|
||||
@@ -12,6 +12,18 @@ $(function()
|
||||
}
|
||||
});
|
||||
|
||||
$('#allParams, #allActions').click(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$(this).parents('tr').find('input[type=checkbox]').attr('checked', 'checked');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).parents('tr').find('input[type=checkbox]').removeAttr('checked');
|
||||
}
|
||||
});
|
||||
|
||||
$('#name').focus();
|
||||
$('#paramstext').attr('disabled', 'disabled');
|
||||
});
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
$lang->webhook->common = 'Webhook';
|
||||
$lang->webhook->list = 'Hook List';
|
||||
$lang->webhook->api = 'API';
|
||||
$lang->webhook->entry = 'Entry';
|
||||
$lang->webhook->log = 'Log';
|
||||
$lang->webhook->assigned = 'Assigned To';
|
||||
|
||||
$lang->webhook->browse = 'Browse';
|
||||
$lang->webhook->create = 'Create';
|
||||
$lang->webhook->edit = 'Edit';
|
||||
$lang->webhook->delete = 'Delete';
|
||||
|
||||
$lang->webhook->id = 'ID';
|
||||
$lang->webhook->type = 'Type';
|
||||
$lang->webhook->name = 'Name';
|
||||
$lang->webhook->url = 'Webhook Address';
|
||||
$lang->webhook->contentType = 'Content Type';
|
||||
$lang->webhook->sendType = 'Send Type';
|
||||
$lang->webhook->product = 'Product';
|
||||
$lang->webhook->project = 'Project';
|
||||
$lang->webhook->params = 'Params';
|
||||
$lang->webhook->action = 'Action';
|
||||
$lang->webhook->desc = 'Desc';
|
||||
$lang->webhook->createdBy = 'Created By';
|
||||
$lang->webhook->createdDate = 'Created Date';
|
||||
$lang->webhook->editedby = 'Edited By';
|
||||
$lang->webhook->editedDate = 'Edited Date';
|
||||
$lang->webhook->date = 'Date';
|
||||
$lang->webhook->data = 'Data';
|
||||
$lang->webhook->result = 'Result';
|
||||
|
||||
$lang->webhook->typeList['bearychat'] = 'Bearychat';
|
||||
$lang->webhook->typeList['dingding'] = 'Dingding';
|
||||
$lang->webhook->typeList['default'] = 'Default';
|
||||
|
||||
$lang->webhook->sendTypeList['sync'] = 'Synchronization';
|
||||
$lang->webhook->sendTypeList['async'] = 'Asynchronous';
|
||||
|
||||
$lang->webhook->paramsList['objectType'] = 'Object Type';
|
||||
$lang->webhook->paramsList['objectID'] = 'Object ID';
|
||||
$lang->webhook->paramsList['product'] = 'Product';
|
||||
$lang->webhook->paramsList['project'] = 'Project';
|
||||
$lang->webhook->paramsList['action'] = 'Action';
|
||||
$lang->webhook->paramsList['actor'] = 'Actor';
|
||||
$lang->webhook->paramsList['date'] = 'Date';
|
||||
$lang->webhook->paramsList['comment'] = 'Comment';
|
||||
$lang->webhook->paramsList['text'] = 'Action Desc';
|
||||
|
||||
$lang->webhook->saveSuccess = 'Save success.';
|
||||
$lang->webhook->confirmDelete = 'Are your sure delete this hook?';
|
||||
|
||||
$lang->webhook->trimWords = '';
|
||||
|
||||
$lang->webhook->note = new stdClass();
|
||||
$lang->webhook->note->async = 'If the send type is asynchronous, need open cron.';
|
||||
$lang->webhook->note->product = 'All actions will trigger the hook if the product is empty, else only actions of the product will trigger it.';
|
||||
$lang->webhook->note->project = 'All actions will trigger the hook if the project is empty, else only actions of the project will trigger it.';
|
||||
|
||||
$lang->webhook->note->typeList['bearychat'] = 'Add a zentao bot in bearychat and get the webhook address.';
|
||||
$lang->webhook->note->typeList['dingding'] = 'Add a customed bot in dingding and get the webhook address.';
|
||||
$lang->webhook->note->typeList['default'] = 'Get webhook address from others';
|
||||
@@ -17,9 +17,9 @@ $lang->webhook->name = '名称';
|
||||
$lang->webhook->url = 'Hook地址';
|
||||
$lang->webhook->contentType = '内容类型';
|
||||
$lang->webhook->sendType = '发送方式';
|
||||
$lang->webhook->params = '参数';
|
||||
$lang->webhook->product = '关联产品';
|
||||
$lang->webhook->project = '关联项目';
|
||||
$lang->webhook->params = '参数';
|
||||
$lang->webhook->action = '触发动作';
|
||||
$lang->webhook->desc = '描述';
|
||||
$lang->webhook->createdBy = '由谁创建';
|
||||
|
||||
+16
-22
@@ -79,11 +79,9 @@ class webhookModel extends model
|
||||
|
||||
$action = $actions[$log->action];
|
||||
|
||||
$text = $this->app->user->realname . $this->lang->action->label->{$action->action}. $this->lang->action->objectTypes[$action->objectType];
|
||||
$object = $this->dao->select('*')->from($this->config->objectTables[$action->objectType])->where('id')->eq($action->objectID)->fetch();
|
||||
$field = $this->config->action->objectNameFields[$action->objectType];
|
||||
$text .= "[#{$action->objectID}::{$object->$field}]";
|
||||
if($action->action == 'assigned') $text .= ' ' . $this->lang->webhook->assigned . ' ' . zget($users, $object->assignedTo);
|
||||
$text = $this->app->user->realname . $this->lang->action->label->{$action->action}. $this->lang->action->objectTypes[$action->objectType] . "[#{$action->objectID}::{$object->$field}]";
|
||||
|
||||
$log->action = $text;
|
||||
$log->actionURL = $this->getViewLink($action->objectType, $action->objectID);
|
||||
@@ -151,6 +149,7 @@ class webhookModel extends model
|
||||
->join('products', ',')
|
||||
->join('projects', ',')
|
||||
->skipSpecial('url')
|
||||
->remove('allParams, allActions')
|
||||
->get();
|
||||
$webhook->params = $this->post->params ? implode(',', $this->post->params) . ',text' : 'text';
|
||||
$webhook->actions = $this->post->actions ? json_encode($this->post->actions) : '[]';
|
||||
@@ -177,6 +176,7 @@ class webhookModel extends model
|
||||
->join('products', ',')
|
||||
->join('projects', ',')
|
||||
->skipSpecial('url')
|
||||
->remove('allParams, allActions')
|
||||
->get();
|
||||
$webhook->params = $this->post->params ? implode(',', $this->post->params) . ',text' : 'text';
|
||||
$webhook->actions = $this->post->actions ? json_encode($this->post->actions) : '[]';
|
||||
@@ -217,9 +217,8 @@ class webhookModel extends model
|
||||
continue;
|
||||
}
|
||||
|
||||
$contentType = zget($this->config->webhook->contentTypes, $webhook->contentType, 'application/json');
|
||||
$result = $this->fetchHook($contentType, $webhook->url, $postData);
|
||||
$this->saveLog($id, $actionID, $webhook->url, $contentType, $postData, $result);
|
||||
$result = $this->fetchHook($webhook, $postData);
|
||||
$this->saveLog($webhook, $actionID, $postData, $result);
|
||||
}
|
||||
return !dao::isError();
|
||||
}
|
||||
@@ -268,18 +267,15 @@ class webhookModel extends model
|
||||
$email = '';
|
||||
if($actionType == 'assigned')
|
||||
{
|
||||
$assignedTo = $object->assignedTo;
|
||||
foreach($users as $user)
|
||||
{
|
||||
if($user->account == $object->assignedTo)
|
||||
{
|
||||
$assignedTo = $user->realname;
|
||||
$mobile = $user->mobile;
|
||||
$email = $user->email;
|
||||
$mobile = $user->mobile;
|
||||
$email = $user->email;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$text .= ' ' . $this->lang->webhook->assigned . ' ' . $assignedTo;
|
||||
}
|
||||
$action->text = $text;
|
||||
|
||||
@@ -396,18 +392,17 @@ class webhookModel extends model
|
||||
/**
|
||||
* Post hook data.
|
||||
*
|
||||
* @param string $contentType
|
||||
* @param string $url
|
||||
* @param object $webhook
|
||||
* @param string $sendData
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function fetchHook($contentType, $url, $sendData)
|
||||
public function fetchHook($webhook, $sendData)
|
||||
{
|
||||
$header[] = "Content-Type: $contentType;charset=utf-8";
|
||||
$header[] = "Content-Type: {$webhook->contentType};charset=utf-8";
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_URL, $webhook->url);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $sendData);
|
||||
@@ -451,22 +446,21 @@ class webhookModel extends model
|
||||
*
|
||||
* @param int $webhookID
|
||||
* @param int $actionID
|
||||
* @param string $url
|
||||
* @param string $contentType
|
||||
* @param object $webhook
|
||||
* @param string $data
|
||||
* @param string $result
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function saveLog($webhookID, $actionID, $url, $contentType, $data, $result)
|
||||
public function saveLog($webhook, $actionID, $data, $result)
|
||||
{
|
||||
$log = new stdclass();
|
||||
$log->objectType = 'webhook';
|
||||
$log->objectID = $webhookID;
|
||||
$log->objectID = $webhook->id;
|
||||
$log->action = $actionID;
|
||||
$log->date = helper::now();
|
||||
$log->url = $url;
|
||||
$log->contentType = $contentType;
|
||||
$log->url = $webhook->url;
|
||||
$log->contentType = $webhook->contentType;
|
||||
$log->data = $data;
|
||||
$log->result = $result;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<tr>
|
||||
<?php $vars = "orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
|
||||
<th class='w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->webhook->id);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('type', $orderBy, $vars, $lang->webhook->type);?></th>
|
||||
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->webhook->name);?></th>
|
||||
<th class='w-60px'><?php common::printOrderLink('type', $orderBy, $vars, $lang->webhook->type);?></th>
|
||||
<th class='w-200px text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->webhook->name);?></th>
|
||||
<th><?php common::printOrderLink('url', $orderBy, $vars, $lang->webhook->url);?></th>
|
||||
<th class='w-70px'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
@@ -28,7 +28,7 @@
|
||||
<?php foreach($webhooks as $id => $webhook):?>
|
||||
<tr>
|
||||
<td class='text-center'><?php echo $id;?></td>
|
||||
<td><?php echo zget($lang->webhook->typeList, $webhook->type);?></td>
|
||||
<td class='text-center'><?php echo zget($lang->webhook->typeList, $webhook->type);?></td>
|
||||
<td class='text' title='<?php echo $webhook->name;?>'><?php echo $webhook->name;?></td>
|
||||
<td class='text' title='<?php echo $webhook->url;?>'><?php echo $webhook->url;?></td>
|
||||
<td class='text-right'>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<form id='webhookForm' method='post' class='ajaxForm'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->webhook->type;?></th>
|
||||
<th class='w-100px'><?php echo $lang->webhook->type;?></th>
|
||||
<td class='w-p50'><?php echo html::select('type', $lang->webhook->typeList, 'default', "class='form-control'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@@ -37,11 +37,6 @@
|
||||
<td><?php echo html::input('url', '', "class='form-control'");?></td>
|
||||
<td id='urlNote'><?php echo $lang->webhook->note->typeList['default'];?></td>
|
||||
</tr>
|
||||
<tr id='contentTypeTR'>
|
||||
<th><?php echo $lang->webhook->contentType;?></th>
|
||||
<td><?php echo html::select('contentType', $config->webhook->contentTypes, '', "class='form-control'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id='sendTypeTR'>
|
||||
<th><?php echo $lang->webhook->sendType;?></th>
|
||||
<td><?php echo html::select('sendType', $lang->webhook->sendTypeList, '', "class='form-control'");?></td>
|
||||
@@ -58,11 +53,19 @@
|
||||
<td><?php echo $lang->webhook->note->project;?></td>
|
||||
</tr>
|
||||
<tr id='paramsTR'>
|
||||
<th><?php echo $lang->webhook->params;?></th>
|
||||
<th>
|
||||
<label class='checkbox-inline'>
|
||||
<input type='checkbox' id='allParams' name='allParams'><strong><?php echo $lang->webhook->params;?></strong>
|
||||
</label>
|
||||
</th>
|
||||
<td class='labelWidth' colspan='2'><?php echo html::checkbox('params', $lang->webhook->paramsList, 'text');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->webhook->action;?></th>
|
||||
<th>
|
||||
<label class='checkbox-inline'>
|
||||
<input type='checkbox' id='allActions' name='allActions'><strong><?php echo $lang->webhook->action;?></strong>
|
||||
</label>
|
||||
</th>
|
||||
<td colspan='2'>
|
||||
<table class='table table-bordered'>
|
||||
<?php foreach($config->webhook->objectTypes as $objectType => $actions):?>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<form id='webhookForm' method='post' class='ajaxForm'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->webhook->name;?></th>
|
||||
<th class='w-100px'><?php echo $lang->webhook->name;?></th>
|
||||
<td class='w-p50'><?php echo html::input('name', $webhook->name, "class='form-control'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@@ -32,11 +32,6 @@
|
||||
<td><?php echo zget($lang->webhook->note->typeList, $webhook->type);?></td>
|
||||
</tr>
|
||||
<?php if($webhook->type != 'dingding'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->webhook->contentType;?></th>
|
||||
<td><?php echo html::select('contentType', $config->webhook->contentTypes, $webhook->contentType, "class='form-control'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->webhook->sendType;?></th>
|
||||
<td><?php echo html::select('sendType', $lang->webhook->sendTypeList, $webhook->sendType, "class='form-control'");?></td>
|
||||
@@ -55,12 +50,20 @@
|
||||
</tr>
|
||||
<?php if(strpos(',bearychat,dingding,', ",$webhook->type,") === false):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->webhook->params;?></th>
|
||||
<th>
|
||||
<label class='checkbox-inline'>
|
||||
<input type='checkbox' id='allParams' name='allParams'><strong><?php echo $lang->webhook->params;?></strong>
|
||||
</label>
|
||||
</th>
|
||||
<td class='labelWidth' colspan='2'><?php echo html::checkbox('params', $lang->webhook->paramsList, $webhook->params);?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->webhook->action;?></th>
|
||||
<th>
|
||||
<label class='checkbox-inline'>
|
||||
<input type='checkbox' id='allActions' name='allActions'><strong><?php echo $lang->webhook->action;?></strong>
|
||||
</label>
|
||||
</th>
|
||||
<td colspan='2'>
|
||||
<table class='table table-bordered'>
|
||||
<?php foreach($config->webhook->objectTypes as $objectType => $actions):?>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<?php
|
||||
echo "<li id='entry'>"; common::printLink('entry', 'browse', '', $lang->webhook->entry); echo '</li>';
|
||||
//echo "<li id='entry'>"; common::printLink('entry', 'browse', '', $lang->webhook->entry); echo '</li>';
|
||||
echo "<li id='webhook' class='active'>"; common::printLink('webhook', 'browse', '', $lang->webhook->common); echo '</li>';
|
||||
?>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user