本文整理汇总了PHP中Portlet::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Portlet::getAll方法的具体用法?PHP Portlet::getAll怎么用?PHP Portlet::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Portlet
的用法示例。
在下文中一共展示了Portlet::getAll方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSuperUserAllDefaultControllerActions
public function testSuperUserAllDefaultControllerActions()
{
// key used to test persistance of user settings
$configKey = 'rollup';
//Set the current user as the super user.
$super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
$accounts = Account::getAll();
$this->assertEquals(1, count($accounts));
$superAccountId = self::getModelIdByModelNameAndName('Account', 'superAccount');
//Load Details view to generate the portlets.
$this->setGetArray(array('id' => $superAccountId));
$this->resetPostArray();
$this->runControllerWithNoExceptionsAndGetContent('accounts/default/details');
//Find the LatestActivity portlet.
$portletToUse = null;
$portlets = Portlet::getAll();
foreach ($portlets as $portlet) {
if ($portlet->viewType == 'AccountLatestActivitiesForPortlet') {
$portletToUse = $portlet;
break;
}
}
$this->assertNotNull($portletToUse);
$this->assertEquals('AccountLatestActivitiesForPortletView', get_class($portletToUse->getView()));
//Load the portlet details for latest activity
$getData = array('id' => $superAccountId, 'portletId' => $portletToUse->id, 'uniqueLayoutId' => 'AccountDetailsAndRelationsView_' . $portletToUse->id, 'LatestActivitiesConfigurationForm' => array('filteredByModelName' => 'all', 'rollup' => ''));
$this->setGetArray($getData);
$this->resetPostArray();
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
$this->assertTrue(LatestActivitiesPortletPersistentConfigUtil::getForCurrentUserByPortletIdAndKey($getData['portletId'], $configKey) === '');
//Now add roll up
$getData['LatestActivitiesConfigurationForm']['rollup'] = '1';
$this->setGetArray($getData);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
$this->assertTrue(LatestActivitiesPortletPersistentConfigUtil::getForCurrentUserByPortletIdAndKey($getData['portletId'], $configKey) === '1');
//Now filter by meeting, task, and note
$getData['LatestActivitiesConfigurationForm']['filteredByModelName'] = 'Meeting';
$this->setGetArray($getData);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
$getData['LatestActivitiesConfigurationForm']['filteredByModelName'] = 'Note';
$this->setGetArray($getData);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
$getData['LatestActivitiesConfigurationForm']['filteredByModelName'] = 'Task';
$this->setGetArray($getData);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
//Now do the same thing with filtering but turn off rollup.
$getData['LatestActivitiesConfigurationForm']['rollup'] = '';
$getData['LatestActivitiesConfigurationForm']['filteredByModelName'] = 'Meeting';
$this->setGetArray($getData);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
$this->assertTrue(LatestActivitiesPortletPersistentConfigUtil::getForCurrentUserByPortletIdAndKey($getData['portletId'], $configKey) === '');
$getData['LatestActivitiesConfigurationForm']['filteredByModelName'] = 'Note';
$this->setGetArray($getData);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
$getData['LatestActivitiesConfigurationForm']['filteredByModelName'] = 'Task';
$this->setGetArray($getData);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
}
示例2: testDashboardGroupByActions
public function testDashboardGroupByActions()
{
$portets = Portlet::getAll();
$this->assertCount(1, $portets);
$this->setGetArray(array('portletId' => $portets[0]->id, 'uniqueLayoutId' => 'MarketingDashboard'));
$this->setPostArray(array('MarketingOverallMetricsForm' => array('groupBy' => MarketingOverallMetricsForm::GROUPING_TYPE_DAY)));
$this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigSave');
$this->setPostArray(array('MarketingOverallMetricsForm' => array('groupBy' => MarketingOverallMetricsForm::GROUPING_TYPE_MONTH)));
$this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigSave');
$this->setPostArray(array('MarketingOverallMetricsForm' => array('groupBy' => MarketingOverallMetricsForm::GROUPING_TYPE_WEEK)));
$this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigSave');
}
示例3: testMarketingListDashboardGroupByActions
public function testMarketingListDashboardGroupByActions()
{
$portlets = Portlet::getAll();
foreach ($portlets as $portlet) {
if ($portlet->viewType = 'MarketingListOverallMetrics') {
$marketingListPortlet = $portlet;
}
}
$marketingLists = MarketingList::getAll();
$this->setGetArray(array('portletId' => $portlet->id, 'uniqueLayoutId' => 'MarketingListDetailsAndRelationsViewLeftBottomView', 'portletParams' => array('relationModelId' => $marketingLists[0]->id, 'relationModuleId' => 'marketingLists')));
$this->setPostArray(array('MarketingOverallMetricsForm' => array('groupBy' => MarketingOverallMetricsForm::GROUPING_TYPE_DAY)));
$this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigSave');
$this->setPostArray(array('MarketingOverallMetricsForm' => array('groupBy' => MarketingOverallMetricsForm::GROUPING_TYPE_MONTH)));
$this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigSave');
$this->setPostArray(array('MarketingOverallMetricsForm' => array('groupBy' => MarketingOverallMetricsForm::GROUPING_TYPE_WEEK)));
$this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigSave');
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:17,代码来源:MarketingListDefaultControllerSuperUserWalkthroughTest.php
示例4: testDetailViewPortletFilteringOnConversations
/**
* @depends testUserEditAndDeletePermissions
*/
public function testDetailViewPortletFilteringOnConversations()
{
if (!SECURITY_OPTIMIZED) {
return;
}
$super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
$accounts = Account::getByName('superAccount');
$superAccountId = $accounts[0]->id;
//Load Details view to generate the portlets.
$this->setGetArray(array('id' => $superAccountId));
$this->resetPostArray();
$this->runControllerWithNoExceptionsAndGetContent('accounts/default/details');
//Find the LatestActivity portlet.
$portletToUse = null;
$portlets = Portlet::getAll();
foreach ($portlets as $portlet) {
if ($portlet->viewType == 'AccountLatestActivitiesForPortlet') {
$portletToUse = $portlet;
break;
}
}
$this->assertNotNull($portletToUse);
$this->assertEquals('AccountLatestActivitiesForPortletView', get_class($portletToUse->getView()));
//Load the portlet details for latest activity
$getData = array('id' => $superAccountId, 'portletId' => $portletToUse->id, 'uniqueLayoutId' => 'AccountDetailsAndRelationsView_2', 'LatestActivitiesConfigurationForm' => array('filteredByModelName' => 'all', 'rollup' => false));
$this->setGetArray($getData);
$this->resetPostArray();
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
//Now add roll up
$getData['LatestActivitiesConfigurationForm']['rollup'] = true;
$this->setGetArray($getData);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
//Now filter by conversation
$getData['LatestActivitiesConfigurationForm']['filteredByModelName'] = 'Conversation';
$this->setGetArray($getData);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
//Now do the same thing with filtering but turn off rollup.
$getData['LatestActivitiesConfigurationForm']['rollup'] = true;
$getData['LatestActivitiesConfigurationForm']['filteredByModelName'] = 'Conversation';
$this->setGetArray($getData);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/defaultPortlet/details');
}
示例5: testDeleteDashboardAndRelatedPortlets
/**
* testGetRowsByUserId
*/
public function testDeleteDashboardAndRelatedPortlets()
{
Yii::app()->user->userModel = User::getByUsername('billy');
$dashboardCount = count(Dashboard::getAll());
$this->assertTrue($dashboardCount > 0);
$user = User::getByUserName('billy');
Yii::app()->user->userModel = $user;
$dashboard = new Dashboard();
$dashboard->name = "Dashboard TESTING";
$dashboard->layoutId = 3;
$dashboard->owner = $user;
$dashboard->layoutType = '100';
$dashboard->isDefault = false;
$this->assertTrue($dashboard->save());
$this->assertEquals(count(Portlet::getAll()), 0);
$this->assertEquals(count(Dashboard::getAll()), $dashboardCount + 1);
for ($i = 1; $i <= 3; $i++) {
$portlet = new Portlet();
$portlet->column = 1;
$portlet->position = 1 + $i;
$portlet->layoutId = 'TEST' . $dashboard->layoutId;
$portlet->collapsed = false;
$portlet->viewType = 'TasksMyList';
$portlet->user = $user;
$this->assertTrue($portlet->save());
}
$this->assertEquals(count(Portlet::getAll()), 3);
$portlets = Portlet::getByLayoutIdAndUserSortedById('TEST' . $dashboard->layoutId, $user->id);
foreach ($portlets as $portlet) {
$portlet->delete();
}
$dashboard->delete();
$this->assertEquals(count(Portlet::getAll()), 0);
$this->assertEquals(count(Dashboard::getAll()), $dashboardCount);
}