Merge branch 'master' into zenops_46_tanghucheng
This commit is contained in:
+26
-1
@@ -50,7 +50,7 @@ class actionModel extends model
|
||||
$action->extra = $extra;
|
||||
if(!defined('IN_UPGRADE')) $action->vision = $this->config->vision;
|
||||
|
||||
if($objectType == 'story' and strpos(',reviewpassed,reviewrejected,reviewclarified,reviewreverted,', ",$actionType,") !== false) $action->actor = $this->lang->action->system;
|
||||
if($objectType == 'story' and strpos(',reviewpassed,reviewrejected,reviewclarified,reviewreverted,synctwins,', ",$actionType,") !== false) $action->actor = $this->lang->action->system;
|
||||
|
||||
/* Use purifier to process comment. Fix bug #2683. */
|
||||
$action->comment = fixer::stripDataTags($comment);
|
||||
@@ -289,6 +289,15 @@ class actionModel extends model
|
||||
if(strpos(',deleted,', ",$actionType,") !== false) $module = $this->dao->select('*')->from(TABLE_MODULE)->where('id')->eq($objectID)->fetch();
|
||||
if(!empty($module) and $module->type == 'story') $record['product'] = $module->root;
|
||||
break;
|
||||
case 'review':
|
||||
$result = $this->dao->select('*')->from($this->config->objectTables[$objectType])->where('id')->eq($objectID)->fetch();
|
||||
if($result)
|
||||
{
|
||||
$products = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($result->project)->fetchPairs('product');
|
||||
$record['product'] = join(',', array_keys($products));
|
||||
$record['project'] = zget($result, 'project', 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$result = $this->dao->select('*')->from($this->config->objectTables[$objectType])->where('id')->eq($objectID)->fetch();
|
||||
$record['product'] = zget($result, 'product', '0');
|
||||
@@ -964,6 +973,17 @@ class actionModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
if($action->objectType == 'story' and $action->action == 'synctwins')
|
||||
{
|
||||
if(!empty($extra) and strpos($extra, '|') !== false)
|
||||
{
|
||||
list($operate, $storyID) = explode('|', $extra);
|
||||
$desc['operate'] = $this->lang->$objectType->{$desc['operate']};
|
||||
$link = common::hasPriv('story', 'view') ? html::a(helper::createLink('story', 'view', "storyID=$storyID"), "#$storyID ") : "#$storyID";
|
||||
$actionDesc = str_replace(array('$extra', '$operate'), array($link, $desc['operate'][$operate]), $desc['main']);
|
||||
}
|
||||
}
|
||||
|
||||
if($action->objectType == 'module' and strpos(',created,moved,', $action->action) !== false)
|
||||
{
|
||||
$moduleNames = $this->loadModel('tree')->getOptionMenu($action->objectID, 'story', 0, 'all', '');
|
||||
@@ -1834,6 +1854,11 @@ class actionModel extends model
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($action->objectType == 'release')
|
||||
{
|
||||
$release = $this->dao->select('*')->from(TABLE_RELEASE)->where('id')->eq($action->objectID)->fetch();
|
||||
if($release->shadow) $this->dao->update(TABLE_BUILD)->set('deleted')->eq(0)->where('id')->eq($release->shadow)->exec();
|
||||
}
|
||||
|
||||
/* Update deleted field in object table. */
|
||||
$table = $this->config->objectTables[$action->objectType];
|
||||
|
||||
Reference in New Issue
Block a user