Permalink
Browse files

resolve conflict

  • Loading branch information...
1 parent 7b4b2ac commit 2c482758686faea50c16f35e0613a852deb4e094 Alex Hudenko committed Nov 23, 2011
@@ -8,11 +8,13 @@ public function actionDelete($id = null) {
if (!$id) {
$messagesData = Yii::app()->request->getParam('Message');
$counter = 0;
- foreach ($messagesData as $messageData) {
- if (isset($messageData['selected'])) {
- $message = Message::model()->findByPk($messageData['id']);
- if ($message->deleteByUser(Yii::app()->user->getId())) {
- $counter++;
+ if ($messagesData) {
+ foreach ($messagesData as $messageData) {
+ if (isset($messageData['selected'])) {
+ $message = Message::model()->findByPk($messageData['id']);
+ if ($message->deleteByUser(Yii::app()->user->getId())) {
+ $counter++;
+ }
}
}
}
@@ -28,7 +28,7 @@ public function actionView() {
$message->subject = preg_match('/^Re:/',$viewedMessage->subject) ? $viewedMessage->subject : 'Re: ' . $viewedMessage->subject;
$message->receiver_id = $viewedMessage->sender_id;
} else {
- $message->sender_id = $viewedMessage->receiver_id;
+ $message->receiver_id = $viewedMessage->receiver_id;
}
if (Yii::app()->request->getPost('Message')) {
@@ -21,6 +21,7 @@
<tr>
<th class="label">From</th>
<th class="label">Subject</th>
+ <th class="label">Date</th>
</tr>
<?php foreach ($messagesAdapter->data as $index => $message): ?>
<tr class="<?php echo $message->is_read ? 'read' : 'unread' ?>">
@@ -30,6 +31,7 @@
<?php echo $message->getSenderName(); ?>
</td>
<td><a href="<?php echo $this->createUrl('view/', array('message_id' => $message->id)) ?>"><?php echo $message->subject ?></a></td>
+ <td><span class="date"><?php echo date(Yii::app()->getModule('message')->dateFormat, strtotime($message->created_at)) ?></span></td>
</tr>
<?php endforeach ?>
</table>
@@ -30,6 +30,7 @@
<?php echo $message->getReceiverName() ?>
</td>
<td><a href="<?php echo $this->createUrl('view/', array('message_id' => $message->id)) ?>"><?php echo $message->subject ?></a></td>
+ <td><span class="date"><?php echo date(Yii::app()->getModule('message')->dateFormat, strtotime($message->created_at)) ?></span></td>
</tr>
<?php endforeach ?>
</table>
@@ -24,6 +24,7 @@
<tr>
<th class="from-to">From</th>
<th>Subject</th>
+ <th>Date</th>
</tr>
<?php foreach ($messagesAdapter->data as $index => $message): ?>
<tr class="<?php echo $message->is_read ? 'read' : 'unread' ?>">
@@ -33,6 +34,7 @@
<?php echo $message->getSenderName(); ?>
</td>
<td><a href="<?php echo $this->createUrl('view/', array('message_id' => $message->id)) ?>"><?php echo $message->subject ?></a></td>
+ <td><span class="date"><?php echo date(Yii::app()->getModule('message')->dateFormat, strtotime($message->created_at)) ?></span></td>
</tr>
<?php endforeach ?>
</table>
@@ -26,6 +26,7 @@
<tr>
<th class="from-to">To</th>
<th>Subject</th>
+ <th>Date</th>
</tr>
<?php foreach ($messagesAdapter->data as $index => $message): ?>
<tr>
@@ -35,6 +36,7 @@
<?php echo $message->getReceiverName() ?>
</td>
<td><a href="<?php echo $this->createUrl('view/', array('message_id' => $message->id)) ?>"><?php echo $message->subject ?></a></td>
+ <td><span class="date"><?php echo date(Yii::app()->getModule('message')->dateFormat, strtotime($message->created_at)) ?></span></td>
</tr>
<?php endforeach ?>
</table>

0 comments on commit 2c48275

Please sign in to comment.