* Create action for ztools.
This commit is contained in:
@@ -11,6 +11,47 @@
|
||||
*/
|
||||
class action extends control
|
||||
{
|
||||
/**
|
||||
* Create a action or delete all patch actions, this method is used by the Ztools.
|
||||
*
|
||||
* @param string $objectType
|
||||
* @param string $actionType
|
||||
* @param string $objectName
|
||||
* @param bool $confirmDelete delete all patch actions when upgrade zentao.
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function create($objectType, $actionType, $objectName, $confirmDelete = false)
|
||||
{
|
||||
if($confirmDelete)
|
||||
{
|
||||
$this->dao->delete()->from(TABLE_ACTION)->where('objectType')->eq('patch')->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$actionID = $this->action->create($objectType, 0, $actionType, '', $objectName);
|
||||
|
||||
if($actionID)
|
||||
{
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->send(array('result' => 'fail', 'message' => 'error'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Trash.
|
||||
*
|
||||
|
||||
@@ -139,6 +139,7 @@ $lang->action->objectTypes['kanbancard'] = 'Kanban Card';
|
||||
$lang->action->objectTypes['sonarqube'] = 'SonarQube Server';
|
||||
$lang->action->objectTypes['sonarqubeproject'] = 'SonarQube Project';
|
||||
$lang->action->objectTypes['stage'] = 'Stage';
|
||||
$lang->action->objectTypes['patch'] = 'Patch';
|
||||
|
||||
/* Used to describe operation history. */
|
||||
$lang->action->desc = new stdclass();
|
||||
@@ -232,6 +233,8 @@ $lang->action->desc->unlinkbug = '$date, 由 <strong>$actor</strong> 从计划
|
||||
|
||||
/* Used to display dynamic information. */
|
||||
$lang->action->label = new stdclass();
|
||||
$lang->action->label->install = 'install ';
|
||||
$lang->action->label->revert = 'revert ';
|
||||
$lang->action->label->created = 'created ';
|
||||
$lang->action->label->opened = 'opened ';
|
||||
$lang->action->label->openedbysystem = 'Opened by system ';
|
||||
|
||||
@@ -139,6 +139,7 @@ $lang->action->objectTypes['kanbancard'] = '看板卡片';
|
||||
$lang->action->objectTypes['sonarqube'] = 'SonarQube服务器';
|
||||
$lang->action->objectTypes['sonarqubeproject'] = 'SonarQube项目';
|
||||
$lang->action->objectTypes['stage'] = '阶段';
|
||||
$lang->action->objectTypes['patch'] = '补丁';
|
||||
|
||||
/* 用来描述操作历史记录。*/
|
||||
$lang->action->desc = new stdclass();
|
||||
@@ -232,6 +233,8 @@ $lang->action->desc->unlinkbug = '$date, 由 <strong>$actor</strong> 从计划
|
||||
|
||||
/* 用来显示动态信息。*/
|
||||
$lang->action->label = new stdclass();
|
||||
$lang->action->label->install = '安装';
|
||||
$lang->action->label->revert = '还原';
|
||||
$lang->action->label->created = '创建';
|
||||
$lang->action->label->opened = '创建';
|
||||
$lang->action->label->openedbysystem = '系统创建';
|
||||
|
||||
Reference in New Issue
Block a user