/** * Tests finding of forums of project */ public function testGetForums() { global $AppUI; $forums = CProject::getForums($AppUI, 1); $this->assertEquals(1, count($forums)); $this->assertEquals(1, $forums[1]['forum_id']); $this->assertEquals(1, $forums[1]['forum_project']); $this->assertEquals('This is a forum.', $forums[1]['forum_description']); $this->assertEquals(1, $forums[1]['forum_owner']); $this->assertEquals('Test Forum', $forums[1]['forum_name']); $this->assertEquals(1, $forums[1]['forum_message_count']); $this->assertEquals('04-Aug-2009 17:03', $forums[1]['forum_last_date']); $this->assertEquals('Test Project', $forums[1]['project_name']); $this->assertEquals('FFFFFF', $forums[1]['project_color_identifier']); $this->assertEquals(1, $forums[1]['project_id']); $this->assertEquals(1, $forums[1][0]); $this->assertEquals(1, $forums[1][1]); $this->assertEquals('This is a forum.', $forums[1][2]); $this->assertEquals(1, $forums[1][3]); $this->assertEquals('Test Forum', $forums[1][4]); $this->assertEquals(1, $forums[1][5]); $this->assertEquals('04-Aug-2009 17:03', $forums[1][6]); $this->assertEquals('Test Project', $forums[1][7]); $this->assertEquals('FFFFFF', $forums[1][8]); $this->assertEquals(1, $forums[1][9]); }
<?php /* $Id: vw_forums.php 305 2009-02-22 19:47:10Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/tags/version2.4/modules/projects/vw_forums.php $ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } global $AppUI, $project_id; // Forums mini-table in project view action $forums = CProject::getForums($AppUI, $project_id); ?> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl"> <tr> <th nowrap="nowrap"> </th> <th nowrap="nowrap" width="100%"><?php echo $AppUI->_('Forum Name'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Messages'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Last Post'); ?> </th> </tr> <?php foreach ($forums as $forumId => $forum_info) { ?> <tr>