[pLog-svn] r5641 - in plog/trunk: class/action/admin class/dao class/view/admin templates/admin
mark at devel.lifetype.net
mark at devel.lifetype.net
Tue Jul 10 13:58:25 EDT 2007
Author: mark
Date: 2007-07-10 13:58:25 -0400 (Tue, 10 Jul 2007)
New Revision: 5641
Added:
plog/trunk/class/action/admin/admineditinboxprivatemessagesaction.class.php
plog/trunk/class/view/admin/admininboxprivatemessageslistview.class.php
plog/trunk/templates/admin/editinboxprivatemessages.template
Removed:
plog/trunk/class/action/admin/admineditincomingprivatemessagesaction.class.php
plog/trunk/class/view/admin/adminincomingprivatemessageslistview.class.php
plog/trunk/templates/admin/editincomingprivatemessages.template
Modified:
plog/trunk/class/dao/privatemessage.class.php
plog/trunk/templates/admin/editoutboxprivatemessages.template
Log:
Private messages inbox list view works.
Copied: plog/trunk/class/action/admin/admineditinboxprivatemessagesaction.class.php (from rev 5640, plog/trunk/class/action/admin/admineditincomingprivatemessagesaction.class.php)
===================================================================
--- plog/trunk/class/action/admin/admineditinboxprivatemessagesaction.class.php (rev 0)
+++ plog/trunk/class/action/admin/admineditinboxprivatemessagesaction.class.php 2007-07-10 17:58:25 UTC (rev 5641)
@@ -0,0 +1,37 @@
+<?php
+
+ lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/view/admin/admininboxprivatemessageslistview.class.php" );
+
+ /**
+ * \ingroup Action
+ * @private
+ *
+ * Action that shows the list privatemessages
+ */
+ class AdminEditInboxPrivateMessagesAction extends AdminAction
+ {
+
+ /**
+ * Constructor. If nothing else, it also has to call the constructor of the parent
+ * class, BlogAction with the same parameters
+ */
+ function AdminEditInboxPrivateMessagesAction( $actionInfo, $request )
+ {
+ $this->AdminAction( $actionInfo, $request );
+ }
+
+ /**
+ * Carries out the specified action
+ */
+ function perform()
+ {
+ $searchTerms = $this->_request->getValue( "searchTerms" );
+ $this->_view = new AdminInboxPrivateMessagesListView( $this->_blogInfo, Array( "searchTerms" => $searchTerms ) );
+ $this->setCommonData();
+
+ // better to return true if everything fine
+ return true;
+ }
+ }
+?>
\ No newline at end of file
Deleted: plog/trunk/class/action/admin/admineditincomingprivatemessagesaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditincomingprivatemessagesaction.class.php 2007-07-10 15:44:48 UTC (rev 5640)
+++ plog/trunk/class/action/admin/admineditincomingprivatemessagesaction.class.php 2007-07-10 17:58:25 UTC (rev 5641)
@@ -1,37 +0,0 @@
-<?php
-
- lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
- lt_include( PLOG_CLASS_PATH."class/view/admin/adminincomingprivatemessageslistview.class.php" );
-
- /**
- * \ingroup Action
- * @private
- *
- * Action that shows the list privatemessages
- */
- class AdminEditIncomingPrivateMessagesAction extends AdminAction
- {
-
- /**
- * Constructor. If nothing else, it also has to call the constructor of the parent
- * class, BlogAction with the same parameters
- */
- function AdminEditIncomingPrivateMessagesAction( $actionInfo, $request )
- {
- $this->AdminAction( $actionInfo, $request );
- }
-
- /**
- * Carries out the specified action
- */
- function perform()
- {
- $searchTerms = $this->_request->getValue( "searchTerms" );
- $this->_view = new AdminIncomingPrivateMessagesListView( $this->_blogInfo, Array( "searchTerms" => $searchTerms ) );
- $this->setCommonData();
-
- // better to return true if everything fine
- return true;
- }
- }
-?>
\ No newline at end of file
Modified: plog/trunk/class/dao/privatemessage.class.php
===================================================================
--- plog/trunk/class/dao/privatemessage.class.php 2007-07-10 15:44:48 UTC (rev 5640)
+++ plog/trunk/class/dao/privatemessage.class.php 2007-07-10 17:58:25 UTC (rev 5641)
@@ -2,12 +2,12 @@
lt_include( PLOG_CLASS_PATH."class/database/dbobject.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/privatemessagereceiverreadstatus.class.php" );
-
+
/**
* \ingroup DAO
*
* This is the representation of a private message. It contains all the information we need to know,
- * such as the boxId, senderId, receiverId, subject, message, date created and whether it's been read
+ * such as the boxId, senderId, receiverId, subject, message, date created and whether it's been read
* by the receiver yet.
*/
class PrivateMessage extends DbObject
@@ -30,12 +30,12 @@
var $_senderInfo;
var $_box;
- function PrivateMessage( $boxId, $receiverId, $senderId, $subject, $message, $date = '',
- $receiverReadStatus = PRIVATE_MESSAGE_RECEIVER_UNREAD, $id = -1 )
+ function PrivateMessage( $boxId, $receiverId, $senderId, $subject, $message, $date = '',
+ $receiverReadStatus = PRIVATE_MESSAGE_RECEIVER_UNREAD, $id = -1 )
{
-
+
$this->DbObject();
-
+
//filling up the object-variables
$this->_boxId = $boxId;
$this->_receiverId = $receiverId;
@@ -52,7 +52,7 @@
}
$this->_receiverReadStatus = $receiverReadStatus;
$this->_id = $id;
-
+
$this->_normalizedSubject = '';
$this->_normalizedMessage = '';
@@ -103,14 +103,14 @@
{
if( empty( $this->_box ) ){
lt_include( PLOG_CLASS_PATH."class/dao/privatemessagebox.class.php" );
-
+
$privateMessageBoxes = new PrivateMessageBoxes();
$this->_box = $privateMessageBoxes->getPrivateMessageBox( $this->_boxId );
}
return $this->_box;
}
-
+
/**
* Returns the receiver id of this message
*
@@ -125,17 +125,17 @@
* Returns the receiver info of this message
*
* @return a UserInfo of the receiver
- */
+ */
function getReceiverInfo() {
if( empty( $this->_receiverInfo ) ){
lt_include( PLOG_CLASS_PATH."class/dao/users.class.php" );
-
+
$users = new Users();
$this->_receiverInfo = $users->getUserInfoFromId($this->_receiverId);
- }
+ }
return $this->_receiverInfo;
}
-
+
/**
* Returns the sender id of this message
*
@@ -149,13 +149,13 @@
function getSenderInfo() {
if( empty( $this->_senderInfo ) ){
lt_include( PLOG_CLASS_PATH."class/dao/users.class.php" );
-
+
$users = new Users();
- $this->_senderInfo = $users->getUserInfoFromId($this->_sender);
+ $this->_senderInfo = $users->getUserInfoFromId($this->_senderId);
}
return $this->_senderInfo;
}
-
+
/**
* Returns the subject of this message
*
@@ -165,7 +165,7 @@
{
return $this->_subject;
}
-
+
/**
* Returns the message in this message
*
@@ -186,7 +186,7 @@
if( $this->_normalizedSubject == "" ) {
$this->setNormalizedSubject( $this->getSubject());
}
-
+
return( $this->_normalizedSubject );
}
@@ -194,16 +194,16 @@
* returns the normalized message
*
* @return the normalized message
- */
+ */
function getNormalizedMessage()
{
if( $this->_normalizedMessage == "" ) {
$this->setNormalizedMessage( $this->getMessage());
}
-
+
return( $this->_normalizedMessage );
}
-
+
/**
* Returns the create_date for this message.
*
@@ -228,7 +228,7 @@
return $this->_timestamp;
}
-
+
/**
* @private
*/
@@ -236,7 +236,7 @@
{
return $this->_receiverReadStatus;
}
-
+
/**
* @private
*/
@@ -293,7 +293,7 @@
function setNormalizedSubject( $normalizedSubject )
{
// do a normalization again, just in case
- lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
$this->_normalizedSubject = TextFilter::normalizeText( $normalizedSubject );
}
@@ -301,10 +301,10 @@
* sets the normalized message
*
* @param normalizedMessage
- */
+ */
function setNormalizedMessage( $normalizedMessage )
{
- // do a normalization again, just in case
+ // do a normalization again, just in case
lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
$this->_normalizedMessage = TextFilter::normalizeText( $normalizedMessage );
}
Copied: plog/trunk/class/view/admin/admininboxprivatemessageslistview.class.php (from rev 5640, plog/trunk/class/view/admin/adminincomingprivatemessageslistview.class.php)
===================================================================
--- plog/trunk/class/view/admin/admininboxprivatemessageslistview.class.php (rev 0)
+++ plog/trunk/class/view/admin/admininboxprivatemessageslistview.class.php 2007-07-10 17:58:25 UTC (rev 5641)
@@ -0,0 +1,60 @@
+<?php
+
+ lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/pager/pager.class.php" );
+
+ /**
+ * \ingroup View
+ * @private
+ *
+ * shows a list of private messages
+ */
+ class AdminInboxPrivateMessagesListView extends AdminTemplatedView
+ {
+ var $_page;
+
+ function AdminInboxPrivateMessagesListView( $blogInfo, $params = Array())
+ {
+ $this->AdminTemplatedView( $blogInfo, "editinboxprivatemessages" );
+
+ // save the parameters and put them in a nicer place after checking them
+ if( !isset( $params["searchTerms"] ) ) $params["searchTerms"] = "";
+ $this->setValue( "searchTerms", $params["searchTerms"] );
+
+ $this->_page = $this->getCurrentPageFromRequest();
+ }
+
+ function render()
+ {
+ $searchTerms = $this->getValue( "searchTerms" );
+ $blogSettings = $this->_blogInfo->getSettings();
+ // get the private messages
+ lt_include( PLOG_CLASS_PATH."class/dao/privatemessageboxes.class.php" );
+ $privateMessageBoxes = new PrivateMessageBoxes();
+ $privateMessageInbox = $privateMessageBoxes->getPrivateMessageInboxFromUserId( $this->_userInfo->getId() );
+ $inboxPrivateMessages = $privateMessageInbox->getPrivateMessagesFromBox( $searchTerms,
+ $this->_page,
+ DEFAULT_ITEMS_PER_PAGE );
+
+ // get the total number of private messages
+ $numInboxPrivateMessages = $privateMessageInbox->getNumPrivateMessagesFromBox( $searchTerms );
+
+ // throw the event
+ $this->notifyEvent( EVENT_PRIVATE_MESSAGES_LOADED, Array( "privatemessages" => &$outgoingMessages ));
+
+ // create the pager
+ $pager = new Pager( "?op=editInboxPrivateMessages&searchTerms={$searchTerms}&page=",
+ $this->_page,
+ $numInboxPrivateMessages,
+ DEFAULT_ITEMS_PER_PAGE );
+
+ // create the view and fill the template context
+ $this->setValue( "privatemessages", $inboxPrivateMessages );
+ $this->setValue( "searchTerms", $searchTerms );
+ $this->setValue( "pager", $pager );
+
+ // transfer control to the parent class
+ parent::render();
+ }
+ }
+?>
\ No newline at end of file
Deleted: plog/trunk/class/view/admin/adminincomingprivatemessageslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminincomingprivatemessageslistview.class.php 2007-07-10 15:44:48 UTC (rev 5640)
+++ plog/trunk/class/view/admin/adminincomingprivatemessageslistview.class.php 2007-07-10 17:58:25 UTC (rev 5641)
@@ -1,60 +0,0 @@
-<?php
-
- lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
- lt_include( PLOG_CLASS_PATH."class/dao/privatemessages.class.php" );
- lt_include( PLOG_CLASS_PATH."class/data/pager/pager.class.php" );
-
- /**
- * \ingroup View
- * @private
- *
- * shows a list of private messages
- */
- class AdminIncomingPrivateMessagesListView extends AdminTemplatedView
- {
- var $_page;
-
- function AdminIncomingPrivateMessagesListView( $blogInfo, $params = Array())
- {
- $this->AdminTemplatedView( $blogInfo, "editincomingprivatemessages" );
-
- // save the parameters and put them in a nicer place after checking them
- if( !isset( $params["searchTerms"] ) ) $params["searchTerms"] = "";
- $this->setValue( "searchTerms", $params["searchTerms"] );
-
- $this->_page = $this->getCurrentPageFromRequest();
- }
-
- function render()
- {
- $searchTerms = $this->getValue( "searchTerms" );
- $blogSettings = $this->_blogInfo->getSettings();
- // get the private messages
- $privateMessages = new PrivateMessages();
- $incomingMessages = $privateMessages->getIncomingMessagesFromReceiverId( $this->_userInfo->getId(),
- $searchTerms,
- $this->_page,
- DEFAULT_ITEMS_PER_PAGE );
-
- // get the total number of private messages
- $numIncomingPrivateMessages = $privateMessages->getNumIncomingMessagesFromReceiverId( $this->_userInfo->getId(), $searchTerms );
-
- // throw the event
- $this->notifyEvent( EVENT_PRIVATE_MESSAGES_LOADED, Array( "privatemessages" => &$incomingMessages ));
-
- // create the pager
- $pager = new Pager( "?op=editIncomingPrivateMessages&searchTerms={$searchTerms}&page=",
- $this->_page,
- $numIncomingPrivateMessages,
- DEFAULT_ITEMS_PER_PAGE );
-
- // create the view and fill the template context
- $this->setValue( "privatemessages", $incomingMessages );
- $this->setValue( "searchTerms", $searchTerms );
- $this->setValue( "pager", $pager );
-
- // transfer control to the parent class
- parent::render();
- }
- }
-?>
\ No newline at end of file
Copied: plog/trunk/templates/admin/editinboxprivatemessages.template (from rev 5640, plog/trunk/templates/admin/editincomingprivatemessages.template)
===================================================================
--- plog/trunk/templates/admin/editinboxprivatemessages.template (rev 0)
+++ plog/trunk/templates/admin/editinboxprivatemessages.template 2007-07-10 17:58:25 UTC (rev 5641)
@@ -0,0 +1,84 @@
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=editInboxPrivateMessages title=$locale->tr("editInboxPrivateMessages")}
+<script type="text/javascript">
+{literal}
+YAHOO.util.Event.addListener( window, "load", function() {
+ var t = new Lifetype.UI.TableEffects( "list" );
+ t.stripe();
+ t.highlightRows();
+ });
+{/literal}
+</script>
+ <div id="list_nav_bar">
+ <div id="list_nav_select">
+
+<form id="viewInboxPrivateMessages" action="admin.php" method="post">
+ <fieldset>
+ <legend>{$locale->tr("show_by")}</legend>
+
+ <div class="list_nav_option">
+ <label for="search">{$locale->tr("search_terms")}</label>
+ <br />
+ <input type="text" name="searchTerms" value="{$searchTerms}" size="15" id="search" />
+ </div>
+
+ <div class="list_nav_option">
+ <br />
+ <input type="hidden" name="op" value="editInboxPrivateMessages" />
+ <input type="submit" name="Show" value="{$locale->tr("show")}" />
+ </div>
+ </fieldset>
+ </form>
+ </div>
+ <br style="clear:both" />
+ </div>
+
+ <form id="inboxPrivateMessages" action="admin.php" method="post">
+ <div id="list">
+ {include file="$admintemplatepath/successmessage.template"}
+ {include file="$admintemplatepath/errormessage.template"}
+ <table id="list" class="info" summary="{$locale->tr("editInboxPrivateMessages")}">
+ <thead>
+ <tr>
+ <th><input class="checkbox" type="checkbox" name="all" id="all" value="1" onclick="toggleAllChecks('inboxPrivateMessages');" /></th>
+ <th style="width:15%">{$locale->tr("sender_name")}</th>
+ <th style="width:15%">{$locale->tr("date")}</th>
+ <th style="width:50%">{$locale->tr("subject")}</th>
+ <th style="width:10%">{$locale->tr("receiver_read_status")}</th>
+ <th style="width:10%">{$locale->tr("actions")}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {foreach from=$privatemessages item=privatemessage}
+ <tr>
+ <td align="center"><input class="checkbox" type="checkbox" name="messageIds[{counter}]" value="{$privatemessage->getId()}"/></td>
+ <td class="col_highlighted">
+ {assign var=sender value=$privatemessage->getSenderInfo()}
+ <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$sender->getFullName()}</a>
+ </td>
+ <td>
+ {assign var=date value=$privatemessage->getDateObject()}
+ <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$locale->formatDate($date)}</a>
+ </td>
+ <td>
+ <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$privatemessage->getSubject()}</a>
+ </td>
+ <td>
+ <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$privatemessage->getReceiverReadStatus()}</a>
+ </td>
+ <td>
+ </td>
+ </tr>
+ {/foreach}
+ </tbody>
+ </table>
+ </div>
+ <div id="list_action_bar">
+ {adminpager style=list}
+ <input type="hidden" name="op" value="deleteLinkCategories"/>
+ <input type="submit" name="Delete selected" value="{$locale->tr("delete")}"/>
+ </div>
+ </form>
+
+{include file="$admintemplatepath/footernavigation.template"}
+{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
Deleted: plog/trunk/templates/admin/editincomingprivatemessages.template
===================================================================
--- plog/trunk/templates/admin/editincomingprivatemessages.template 2007-07-10 15:44:48 UTC (rev 5640)
+++ plog/trunk/templates/admin/editincomingprivatemessages.template 2007-07-10 17:58:25 UTC (rev 5641)
@@ -1,86 +0,0 @@
-{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=editIncomingPrivateMessages title=$locale->tr("editIncomingPrivateMessages")}
-<script type="text/javascript">
-{literal}
-YAHOO.util.Event.addListener( window, "load", function() {
- var t = new Lifetype.UI.TableEffects( "list" );
- t.stripe();
- t.highlightRows();
- });
-{/literal}
-</script>
- <div id="list_nav_bar">
- <div id="list_nav_select">
-
-<form id="viewIncomingPrivateMessages" action="admin.php" method="post">
- <fieldset>
- <legend>{$locale->tr("show_by")}</legend>
-
- <div class="list_nav_option">
- <label for="search">{$locale->tr("search_terms")}</label>
- <br />
- <input type="text" name="searchTerms" value="{$searchTerms}" size="15" id="search" />
- </div>
-
- <div class="list_nav_option">
- <br />
- <input type="hidden" name="op" value="editIncomingPrivateMessages" />
- <input type="submit" name="Show" value="{$locale->tr("show")}" />
- </div>
- </fieldset>
- </form>
- </div>
- <br style="clear:both" />
- </div>
-
- <form id="incomingPrivateMessages" action="admin.php" method="post">
- <div id="list">
- {include file="$admintemplatepath/successmessage.template"}
- {include file="$admintemplatepath/errormessage.template"}
- <table id="list" class="info" summary="{$locale->tr("editIncomingPrivateMessages")}">
- <thead>
- <tr>
- <th><input class="checkbox" type="checkbox" name="all" id="all" value="1" onclick="toggleAllChecks('incomingPrivateMessages');" /></th>
- <th style="width:20%">{$locale->tr("senderName")}</th>
- <th style="width:10%">{$locale->tr("date")}</th>
- <th style="width:50%">{$locale->tr("subject")}</th>
- <th style="width:10%">{$locale->tr("status")}</th>
- <th style="width:10%">{$locale->tr("actions")}</th>
- </tr>
- </thead>
- <tbody>
- {foreach from=$privatemessages item=privatemessage}
- <tr>
- <td align="center"><input class="checkbox" type="checkbox" name="messageIds[{counter}]" value="{$privatemessage->getId()}"/></td>
- <td class="col_highlighted">
- <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$privatemessage->getSenderId()}</a>
- </td>
- <td>
- <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$privatemessage->getDate()}</a>
- </td>
- <td>
- <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$privatemessage->getSubject()}</a>
- </td>
- <td>
- <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$privatemessage->getStatus()}</a>
- </td>
- <td>
- <div class="list_action_button">
- <a href="?op=editLinkCategory&categoryId={$category->getId()}"><img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
- <a href="?op=deleteLinkCategory&categoryId={$category->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
- </div>
- </td>
- </tr>
- {/foreach}
- </tbody>
- </table>
- </div>
- <div id="list_action_bar">
- {adminpager style=list}
- <input type="hidden" name="op" value="deleteLinkCategories"/>
- <input type="submit" name="Delete selected" value="{$locale->tr("delete")}"/>
- </div>
- </form>
-
-{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
Modified: plog/trunk/templates/admin/editoutboxprivatemessages.template
===================================================================
--- plog/trunk/templates/admin/editoutboxprivatemessages.template 2007-07-10 15:44:48 UTC (rev 5640)
+++ plog/trunk/templates/admin/editoutboxprivatemessages.template 2007-07-10 17:58:25 UTC (rev 5641)
@@ -41,9 +41,9 @@
<thead>
<tr>
<th><input class="checkbox" type="checkbox" name="all" id="all" value="1" onclick="toggleAllChecks('outboxPrivateMessages');" /></th>
- <th style="width:20%">{$locale->tr("receiverName")}</th>
- <th style="width:20%">{$locale->tr("date")}</th>
- <th style="width:50%">{$locale->tr("subject")}</th>
+ <th style="width:15%">{$locale->tr("receiver_name")}</th>
+ <th style="width:15%">{$locale->tr("date")}</th>
+ <th style="width:60%">{$locale->tr("subject")}</th>
<th style="width:10%">{$locale->tr("actions")}</th>
</tr>
</thead>
@@ -52,10 +52,12 @@
<tr>
<td align="center"><input class="checkbox" type="checkbox" name="messageIds[{counter}]" value="{$privatemessage->getId()}"/></td>
<td class="col_highlighted">
- <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$privatemessage->getReceiverId()}</a>
+ {assign var=receiver value=$privatemessage->getReceiverInfo()}
+ <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$receiver->getFullName()}</a>
</td>
<td>
- <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$privatemessage->getDate()}</a>
+ {assign var=date value=$privatemessage->getDateObject()}
+ <a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$locale->formatDate($date)}</a>
</td>
<td>
<a href="admin.php?op=readPrivateMessage&messageId={$privatemessage->getId()}">{$privatemessage->getSubject()}</a>
More information about the pLog-svn
mailing list