* Finish task #112917.

This commit is contained in:
tanghucheng
2024-03-06 16:46:38 +08:00
parent 0c194de576
commit 2da70bd371
2 changed files with 18 additions and 2 deletions
+8 -2
View File
@@ -649,11 +649,17 @@ class actionModel extends model
$action->extra = sprintf($this->lang->execution->action->extra, '<strong>' . join(', ', $linkedProducts) . '</strong>');
}
}
elseif($objectType == 'demand' && $actionName == 'retracted')
elseif($objectType == 'demand' && in_array($actionName, array('retracted', 'restored')))
{
$story = $this->loadModel('story')->getById($action->extra);
$action->extra = "#{$action->extra} {$this->lang->story->title} " . html::a(helper::createLink('story', 'view', "storyID=$story->id"), "$story->title");
if($story) $action->extra = common::hasPriv('story', 'view') ? "#{$action->extra} {$this->lang->story->title} " . html::a(helper::createLink('story', 'view', "storyID=$story->id"), "$story->title") : "#$action->extra " . $demand->title;
}
elseif($objectType == 'story' && $actionName == 'distributed')
{
$demand = $this->loadModel('demand')->getById($action->extra);
if($demand) $action->extra = common::hasPriv('demand', 'view') ? html::a(helper::createLink('demand', 'view', "demandID=$action->extra"), "#$action->extra " . $demand->title) : "#$action->extra " . $demand->title;
}
$action->history = isset($histories[$actionID]) ? $histories[$actionID] : array();
$actionName = strtolower($action->action);
+10
View File
@@ -2749,6 +2749,9 @@ class storyModel extends model
->add('reviewedDate', '0000-00-00')
->add('duplicateStory', 0)
->add('childStories', '')
->add('retractedReason', '')
->add('retractedBy', '')
->add('retractedDate', NULL)
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', $now)
->setDefault('assignedDate', $now)
@@ -2788,6 +2791,13 @@ class storyModel extends model
$changes = common::createChanges($oldStory, $story);
if(!empty($oldStory->twins)) $this->syncTwins($storyID, $oldStory->twins, $changes, 'Activated');
if($this->config->edition == 'ipd' and $oldStory->demand)
{
$this->loadModel('demand')->changeDemandStatus($oldStory->demand, '0', true);
$this->loadModel('action')->create('demand', $oldStory->demand, 'restored', '', $storyID);
}
return $changes;
}