* Finish task #112917.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user