diff --git a/module/bug/model.php b/module/bug/model.php index db9a72d2e1..856ee2f448 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2181,9 +2181,20 @@ class bugModel extends model $users = $this->loadModel('user')->getPairs('noletter'); /* Get action info. */ - $action = $this->loadModel('action')->getById($actionID); - $history = $this->action->getHistory($actionID); - $action->history = isset($history[$actionID]) ? $history[$actionID] : array(); + $action = $this->loadModel('action')->getById($actionID); + $history = $this->action->getHistory($actionID); + $action->history = isset($history[$actionID]) ? $history[$actionID] : array(); + $action->appendLink = ''; + if(strpos($action->extra, ':')!== false) + { + list($extra, $id) = explode(':', $action->extra); + $action->extra = $extra; + if($id) + { + $name = $this->dao->select('title')->from(TABLE_BUG)->where('id')->eq($id)->fetch('title'); + if($name) $action->appendLink = html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink($action->objectType, 'view', "id=$id"), "#$id " . $name); + } + } /* Get mail content. */ $modulePath = $this->app->getModulePath(); diff --git a/module/mail/model.php b/module/mail/model.php index e574e919a1..52451ea9df 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -298,7 +298,7 @@ class mailModel extends model $this->clear(); /* Replace full webPath image for mail. */ - if(strpos($body, 'src="data/upload')) $body = preg_replace('/config->mail, 'domain', common::getSysURL()) . $this->config->webRoot . 'data/upload', $body); + if(preg_match('/src="\/?data\/upload/U', $body)) $body = preg_replace('/config->mail, 'domain', common::getSysURL()) . $this->config->webRoot . 'data/upload', $body); try { diff --git a/module/story/model.php b/module/story/model.php index 08eace919f..d5dc89e0bd 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2349,7 +2349,18 @@ class storyModel extends model /* Get actions. */ $action = $this->loadModel('action')->getById($actionID); $history = $this->action->getHistory($actionID); - $action->history = isset($history[$actionID]) ? $history[$actionID] : array(); + $action->history = isset($history[$actionID]) ? $history[$actionID] : array(); + $action->appendLink = ''; + if(strpos($action->extra, ':')!== false) + { + list($extra, $id) = explode(':', $action->extra); + $action->extra = $extra; + if($id) + { + $name = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($id)->fetch('title'); + if($name) $action->appendLink = html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink($action->objectType, 'view', "id=$id"), "#$id " . $name); + } + } /* Get mail content. */ $modulePath = $this->app->getModulePath();