Merge branch 'sprint/167_tianshujie_15638' into 'sprint/167'
* Fix bug #15638. See merge request easycorp/zentaopms!115
This commit is contained in:
@@ -456,6 +456,10 @@ $lang->action->dynamicAction->doc['deleted'] = 'Delete Document';
|
||||
$lang->action->dynamicAction->doc['undeleted'] = 'Restore Document';
|
||||
$lang->action->dynamicAction->doc['hidden'] = 'Hide Document';
|
||||
|
||||
$lang->action->dynamicAction->api['created'] = 'Create Interface';
|
||||
$lang->action->dynamicAction->api['edited'] = 'Edit Interface';
|
||||
$lang->action->dynamicAction->api['deleted'] = 'Delete Interface';
|
||||
|
||||
$lang->action->dynamicAction->user['created'] = 'Create User';
|
||||
$lang->action->dynamicAction->user['edited'] = 'Edit User';
|
||||
$lang->action->dynamicAction->user['deleted'] = 'Delete User';
|
||||
@@ -502,6 +506,7 @@ $lang->action->label->risk = 'Risk|risk|view|riskID=%s';
|
||||
$lang->action->label->issue = 'Issue|issue|view|issueID=%s';
|
||||
$lang->action->label->design = 'Design|design|view|designID=%s';
|
||||
$lang->action->label->stakeholder = 'Stakeholder|stakeholder|view|userID=%s';
|
||||
$lang->action->label->api = 'Interface|api|index|libID=%s&moduleID=%s&apiID=%s';
|
||||
|
||||
/* Object type. */
|
||||
$lang->action->search = new stdclass();
|
||||
|
||||
@@ -99,7 +99,6 @@ $lang->action->objectTypes['testreport'] = '报告';
|
||||
$lang->action->objectTypes['doc'] = '文档';
|
||||
$lang->action->objectTypes['api'] = '接口';
|
||||
$lang->action->objectTypes['doclib'] = '文档库';
|
||||
$lang->action->objectTypes['api'] = '接口库';
|
||||
$lang->action->objectTypes['apistruct'] = '数据结构';
|
||||
$lang->action->objectTypes['todo'] = '待办';
|
||||
$lang->action->objectTypes['risk'] = '风险';
|
||||
@@ -456,6 +455,10 @@ $lang->action->dynamicAction->doc['deleted'] = '删除文档';
|
||||
$lang->action->dynamicAction->doc['undeleted'] = '还原文档';
|
||||
$lang->action->dynamicAction->doc['hidden'] = '隐藏文档';
|
||||
|
||||
$lang->action->dynamicAction->api['created'] = '创建接口';
|
||||
$lang->action->dynamicAction->api['edited'] = '编辑接口';
|
||||
$lang->action->dynamicAction->api['deleted'] = '删除接口';
|
||||
|
||||
$lang->action->dynamicAction->user['created'] = '创建用户';
|
||||
$lang->action->dynamicAction->user['edited'] = '编辑用户';
|
||||
$lang->action->dynamicAction->user['deleted'] = '删除用户';
|
||||
@@ -502,6 +505,7 @@ $lang->action->label->risk = '风险|risk|view|riskID=%s';
|
||||
$lang->action->label->issue = '问题|issue|view|issueID=%s';
|
||||
$lang->action->label->design = '设计|design|view|designID=%s';
|
||||
$lang->action->label->stakeholder = '干系人|stakeholder|view|userID=%s';
|
||||
$lang->action->label->api = '接口|api|index|libID=%s&moduleID=%s&apiID=%s';
|
||||
|
||||
/* Object type. */
|
||||
$lang->action->search = new stdclass();
|
||||
|
||||
+14
-2
@@ -1168,10 +1168,15 @@ class actionModel extends model
|
||||
|
||||
$libObjectID = $type != 'custom' ? $action->$type : '';
|
||||
$libObjectID = trim($libObjectID, ',');
|
||||
if(empty($libObjectID)) return false;
|
||||
if(empty($libObjectID) and $type != 'custom') return false;
|
||||
|
||||
$params = sprintf($vars, $type, $libObjectID, $libID);
|
||||
}
|
||||
elseif($action->objectType == 'api')
|
||||
{
|
||||
$api = $this->dao->select('id,lib,module')->from(TABLE_API)->where('id')->eq($action->objectID)->fetch();
|
||||
$params = sprintf($vars, $api->lib, $api->module, $api->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$params = sprintf($vars, $action->objectID);
|
||||
@@ -1183,7 +1188,14 @@ class actionModel extends model
|
||||
$docLib = $this->dao->select('type,product,project,execution,deleted')->from(TABLE_DOCLIB)->where('id')->eq($action->objectID)->fetch();
|
||||
$docLib->objectID = strpos('product,project,execution', $docLib->type) !== false ? $docLib->{$docLib->type} : 0;
|
||||
$appendLib = $docLib->deleted == '1' ? $action->objectID : 0;
|
||||
$action->objectLink = helper::createLink('doc', 'objectLibs', sprintf($vars, $docLib->type, $docLib->objectID, $action->objectID, $appendLib));
|
||||
if($docLib->type == 'api')
|
||||
{
|
||||
$action->objectLink = helper::createLink('api', 'index', "libID={$action->objectID}");
|
||||
}
|
||||
else
|
||||
{
|
||||
$action->objectLink = helper::createLink('doc', 'objectLibs', sprintf($vars, $docLib->type, $docLib->objectID, $action->objectID, $appendLib));
|
||||
}
|
||||
}
|
||||
elseif($action->objectType == 'user')
|
||||
{
|
||||
|
||||
@@ -427,10 +427,13 @@ class api extends control
|
||||
->setDefault('product,module', 0)
|
||||
->get();
|
||||
|
||||
$this->api->update($apiID, $params);
|
||||
if(dao::isError())
|
||||
$changes = $this->api->update($apiID, $params);
|
||||
if(dao::isError()) return $this->sendError(dao::getError());
|
||||
|
||||
if($changes)
|
||||
{
|
||||
return $this->sendError(dao::getError());
|
||||
$actionID = $this->action->create('api', $apiID, 'edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
return $this->sendSuccess(array('locate' => helper::createLink('api', 'index', "libID=0&moduleID=0&apiID=$apiID")));
|
||||
|
||||
@@ -214,6 +214,8 @@ class apiModel extends model
|
||||
->batchCheck($this->config->api->edit->requiredFields, 'notempty')
|
||||
->where('id')->eq($id)
|
||||
->exec();
|
||||
|
||||
return common::createChanges($oldApi, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user