Commits

Jason Green committed d92b116

Adding links to user profile on user image and user names for conversations
missions and social items

Comments (0)

Files changed (4)

app/protected/modules/comments/views/CommentsForRelatedModelView.php

                     $rows++;
                     continue;
                 }
-
-                $stringContent  = $comment->createdByUser->getAvatarImage(36);
-                $userName       = strval($comment->createdByUser);
+                $userUrl        = Yii::app()->createUrl('/users/default/profile', array('id' => $comment->createdByUser->id));
+                $stringContent  = ZurmoHtml::link($comment->createdByUser->getAvatarImage(36), $userUrl);
+                $userName       = ZurmoHtml::link(strval($comment->createdByUser), $userUrl);
                 $stringContent .= '<div class="comment-content"><p>' . $userName . ': ' . $comment->description . '</p>';
 
                 //attachments

app/protected/modules/conversations/views/ConversationDetailsView.php

 
         protected function renderConversationContent()
         {
+            $userUrl  = Yii::app()->createUrl('/users/default/profile', array('id' => $this->model->createdByUser->id));
             $content  = '<div class="comment model-details-summary clearfix">';
-            $content .= $this->model->createdByUser->getAvatarImage(100);
+            $content .= ZurmoHtml::link($this->model->createdByUser->getAvatarImage(100), $userUrl);
             $content .= '<span class="user-details">';
-            $content .= strval($this->model->createdByUser);
+            $content .= ZurmoHtml::link(strval($this->model->createdByUser), $userUrl);
             $content .= '</span>';
             if ($this->model->description == null)
             {

app/protected/modules/missions/views/MissionDetailsView.php

 
         protected function renderMissionContent()
         {
+            $userUrl  = Yii::app()->createUrl('/users/default/profile', array('id' => $this->model->createdByUser->id));
             $content  = '<div class="comment model-details-summary">';
-            $content .= $this->model->createdByUser->getAvatarImage(100);
+            $content .= ZurmoHtml::link($this->model->createdByUser->getAvatarImage(100), $userUrl);
             $content .= '<span class="user-details">';
-            $content .= strval($this->model->createdByUser);
+            $content .= ZurmoHtml::link(strval($this->model->createdByUser), $userUrl);
             $content .= '</span>';
             $element  = new TextAreaElement($this->model, 'description');
             $element->nonEditableTemplate = '<div class="comment-content">{content}</div>';

app/protected/modules/socialItems/utils/SocialItemsUtil.php

         public static function renderItemAndCommentsContent(SocialItem $model, $redirectUrl)
         {
             assert('is_string($redirectUrl) || $redirectUrl == null');
-
+            $userUrl  = Yii::app()->createUrl('/users/default/profile', array('id' => $model->owner->id));
             $content  = '<div class="social-item">';
             $avatarImage = $model->owner->getAvatarImage(50);
             $content .= '<div class="comment model-details-summary clearfix">';
-            $content .= '<span class="user-details">' . $avatarImage;
-            $content .= ZurmoHtml::tag('strong', array(), strval($model->owner) );
+            $content .= '<span class="user-details">' . ZurmoHtml::link($avatarImage, $userUrl);
+            $content .= ZurmoHtml::tag('strong', array(), ZurmoHtml::link(strval($model->owner), $userUrl) );
             $content .= '</span>';
 
             $content .= '<div class="comment-content"><p>' . self::renderModelDescription($model) . '</p></div>';