Exemplo n.º 1
0
 /**
  * get message content
  *
  * @author                                  youzhao.zxw<*****@*****.**>
  * @param   array  $basicInfo               basic info
  * @param   string $infoType                bug,case or result
  * @param   int    $actionId                action id
  * @param   string $repeatStep              repeat step
  * @param   string $replyNote               reply note
  * @return  array                           message content
  */
 private static function getMessageContent($basicInfo, $infoType, $actionId, $repeatStep, $replyNote)
 {
     $infoId = $basicInfo['id'];
     $absoluteUrl = Yii::app()->createAbsoluteUrl('info/edit', array('type' => $infoType, 'id' => $infoId));
     $linkUrl = '<a target="blank" href="' . $absoluteUrl . '">[' . ucfirst($infoType) . ' #' . $infoId . ' => ' . CommonService::getUserRealName($basicInfo['assign_to']) . ']</a>';
     $msgContent = $linkUrl;
     $fileEditInfos = ActionHistoryService::getFileEditInfos($infoType, $infoId);
     $actionInfo = Yii::app()->db->createCommand()->select('*')->from('{{' . $infoType . '_action' . '}}')->where('id = :id', array(':id' => $actionId))->queryRow();
     $fieldLabelArr = FieldConfigService::getCustomFieldLabel($infoType, $basicInfo['product_id']);
     $msgContent .= ActionHistoryService::getSingleActionHistory($fileEditInfos, $actionInfo, $infoType, $infoId, $fieldLabelArr, $basicInfo['product_id']);
     if ('' != $repeatStep) {
         $msgContent .= "<br/><br/>" . str_repeat("-", 20) . "<br/><br/>" . $repeatStep;
     }
     $wangwangMsg = '';
     if (Info::TYPE_BUG == $infoType) {
         $wangwangMsg .= 'Bug #' . $infoId . ':' . CommonService::sysSubStr($basicInfo['title'], 150, true) . "<br/>";
         $wangwangMsg .= $linkUrl;
         if (BugInfo::ACTION_RESOLVE == $actionInfo['action_type']) {
             $wangwangMsg .= Yii::t('BugInfo', $actionInfo['action_type']) . ' as ' . $basicInfo['solution'] . ' by ' . CommonService::getUserRealName($actionInfo['created_by']);
         } else {
             $wangwangMsg .= Yii::t('BugInfo', $actionInfo['action_type']) . ' by ' . CommonService::getUserRealName($actionInfo['created_by']);
         }
         if ($replyNote != '') {
             $wangwangMsg .= "<br/>" . $replyNote;
         }
     }
     return array($msgContent, $wangwangMsg);
 }