Fixed list of participants
authorMarcel Werk <burntime@woltlab.com>
Wed, 21 Nov 2012 00:23:56 +0000 (01:23 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 21 Nov 2012 00:23:56 +0000 (01:23 +0100)
files/lib/data/conversation/ConversationParticipantList.class.php
files/lib/page/ConversationPage.class.php
language/de.xml
templates/conversation.tpl

index ff562a54adbc623c1f994b00ab39cb80cc16e3a7..ae5c91904216b80b6aeccfcfbc802c3735717054 100644 (file)
@@ -3,6 +3,16 @@ namespace wcf\data\conversation;
 use wcf\data\user\UserProfileList;
 use wcf\system\WCF;
 
+/**
+ * Represents a list of conversation participants.
+ * 
+ * @author     Marcel Werk
+ * @copyright  2001-2012 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf.conversation
+ * @subpackage data.conversation
+ * @category   Community Framework
+ */
 class ConversationParticipantList extends UserProfileList {
        /**
         * @see wcf\data\DatabaseObjectList::$sqlLimit
@@ -14,11 +24,16 @@ class ConversationParticipantList extends UserProfileList {
         * 
         * @param       integer         $conversationID
         */
-       public function __construct($conversationID) {
+       public function __construct($conversationID, $userID = 0) {
                parent::__construct();
                
                $this->getConditionBuilder()->add('conversation_to_user.conversationID = ?', array($conversationID));
-               $this->getConditionBuilder()->add('conversation_to_user.isInvisible = 0');
+               if ($userID) {
+                       $this->getConditionBuilder()->add('conversation_to_user.isInvisible = 0 OR conversation_to_user.participantID = ?', array($userID));
+               }
+               else {
+                       $this->getConditionBuilder()->add('conversation_to_user.isInvisible = 0');      
+               }
                $this->sqlConditionJoins .= " LEFT JOIN wcf".WCF_N."_user user_table ON (user_table.userID = conversation_to_user.participantID)";
                
                if (!empty($this->sqlSelects)) $this->sqlSelects .= ',';
index 5deb96bd671fd239258076295deec412fabff984..76c282ae3460bd2e29f10bbda94b95e61f930a1e 100644 (file)
@@ -169,7 +169,7 @@ class ConversationPage extends MultipleLinkPage {
                }
                
                // get participants
-               $this->participantList = new ConversationParticipantList($this->conversationID);
+               $this->participantList = new ConversationParticipantList($this->conversationID, WCF::getUser()->userID);
                $this->participantList->readObjects();
                
                // init quote objects
index 8c953e5ddb1030187ca8274674d76b7518d92d93..6f175ba98a17e1e0ec58eefd46b3408e4e8649c5 100644 (file)
@@ -38,6 +38,7 @@
                <item name="wcf.conversation.hideConversation.leavePermanently.description"><![CDATA[Die Konversation wird verlassen und Sie werden nicht länger als aktiver Teilnehmer gelistet.]]></item>
                <item name="wcf.conversation.hideConversation.restore"><![CDATA[Konversation als &bdquo;aktiv&ldquo; markieren]]></item>
                <item name="wcf.conversation.information"><![CDATA[Informationen]]></item>
+               <item name="wcf.conversation.invisible"><![CDATA[unsichtbar]]></item>
                <item name="wcf.conversation.invisibleParticipants"><![CDATA[Unsichtbare Teilnehmer]]></item>
                <item name="wcf.conversation.invisibleParticipants.description"><![CDATA[Unsichtbare Teilnehmer sind für andere Teilnehmer nicht sichtbar. Mehrere Teilnehmer können mit Komma getrennt angegeben werden.]]></item>
                <item name="wcf.conversation.lastPostTime"><![CDATA[Letzte Antwort]]></item>
index f017ea40c8435747deb9977b6d338ddd4f15bcee..b40a9ab68d431f1a42391400c8e0e56130dd8c5c 100644 (file)
@@ -77,7 +77,9 @@
                                        <li class="box24">
                                                <a href="{link controller='User' object=$participant}{/link}" class="framed">{@$participant->getAvatar()->getImageTag(24)}</a>
                                                <hgroup>
-                                                       <h1><a href="{link controller='User' object=$participant}{/link}" class="userLink{if $participant->hideConversation == 2} conversationLeft{/if}" data-user-id="{@$participant->userID}">{$participant->username}</a></h1>
+                                                       <h1><a href="{link controller='User' object=$participant}{/link}" class="userLink{if $participant->hideConversation == 2} conversationLeft{/if}" data-user-id="{@$participant->userID}">{$participant->username}</a>
+                                                       {if $participant->isInvisible}<small>({lang}wcf.conversation.invisible{/lang})</small>{/if}
+                                                       </h1>
                                                        <h2><dl class="plain inlineDataList">
                                                                <dt>{lang}wcf.conversation.lastVisitTime{/lang}</dt>
                                                                <dd>{if $participant->lastVisitTime}{@$participant->lastVisitTime|time}{else}-{/if}</dd>