本文整理汇总了PHP中Profile::getResultsPerPage方法的典型用法代码示例。如果您正苦于以下问题:PHP Profile::getResultsPerPage方法的具体用法?PHP Profile::getResultsPerPage怎么用?PHP Profile::getResultsPerPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile::getResultsPerPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
public function search($resultsPerPage = null, $uniqueId = null)
{
$criteria = new CDbCriteria();
$parameters = array('limit' => ceil(Profile::getResultsPerPage()));
$criteria->scopes = array('findAll' => array($parameters));
return $this->searchBase($criteria, $resultsPerPage);
}
示例2: setSummaryText
public function setSummaryText()
{
/* add a dropdown to the summary text that let's user set how many rows to show on each
page */
$jqueryMethod = $this->owner instanceof CGridView ? 'yiiGridView' : 'yiiListView';
$this->owner->summaryText = Yii::t('app', '<span class="grid-view-summary-text">
<b>{start}–{end}</b> of <b>{count}</b></span>') . '<div class="form no-border" style="display:inline;"> ' . CHtml::dropDownList('resultsPerPage', Profile::getResultsPerPage(), Profile::getPossibleResultsPerPage(), array('class' => 'x2-minimal-select', 'onchange' => '$.ajax ({
data: {
results: $(this).val ()
},
url: "' . $this->owner->controller->createUrl('/profile/setResultsPerPage') . '",
complete: function (response) {
$.fn.' . $jqueryMethod . '.update("' . $this->owner->id . '", {' . (isset($this->owner->modelName) ? 'data: {' . $this->owner->modelName . '_page: 1},' : '') . 'complete: function () {}' . '});
}
});')) . '</div>';
}
示例3: smartSearch
public function smartSearch($criteria, $pageSize = null)
{
$sort = new SmartSort(get_class($this->owner), isset($this->owner->uid) ? $this->owner->uid : get_class($this->owner));
$sort->multiSort = false;
$sort->attributes = $this->owner->getSort();
$sort->defaultOrder = 't.lastUpdated DESC, t.id DESC';
if (!$pageSize) {
if (!Yii::app()->user->isGuest) {
$pageSize = Profile::getResultsPerPage();
} else {
$pageSize = 20;
}
}
$dataProvider = new SmartActiveDataProvider(get_class($this->owner), array('sort' => $sort, 'pagination' => array('pageSize' => $pageSize), 'criteria' => $criteria, 'uid' => $this->owner->uid, 'dbPersistentGridSettings' => $this->owner->dbPersistentGridSettings));
$sort->applyOrder($criteria);
return $dataProvider;
}
示例4: search
/**
* Retrieves a list of models based on the current search/filter conditions.
* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
*/
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria();
$fields = Fields::model()->findAllByAttributes(array('modelName' => 'ProductFeature'));
foreach ($fields as $field) {
$fieldName = $field->fieldName;
switch ($field->type) {
case 'boolean':
$criteria->compare($field->fieldName, $this->compareBoolean($this->{$fieldName}), true);
break;
case 'assignment':
$criteria->compare($field->fieldName, $this->compareAssignment($this->{$fieldName}), true);
break;
default:
$criteria->compare($field->fieldName, $this->{$fieldName}, true);
}
}
return new CActiveDataProvider(get_class($this), array('criteria' => $criteria, 'pagination' => array('pageSize' => Profile::getResultsPerPage())));
}
示例5: searchBase
/**
* Base search function, includes Retrieves a list of models based on the current
* search/filter conditions.
* @param CDbCriteria $criteria the attribute name
* @param integer $pageSize If set, will override property of profile model
* @return CActiveDataProvider the data provider that can return the models based on the
* search/filter conditions.
*/
public function searchBase($criteria, $pageSize = null, $showHidden = false)
{
if (isset($_GET['showHidden']) && $_GET['showHidden'] && Yii::app()->user->checkAccess(self::getModuleName(get_class($this)) . 'Admin')) {
$showHidden = true;
}
if ($criteria === null) {
$criteria = $this->getAccessCriteria('t', Yii::app()->params->modelPermissions, $showHidden);
} else {
$criteria->mergeWith($this->getAccessCriteria('t', Yii::app()->params->modelPermissions, $showHidden));
}
$filterCriteria = new CDbCriteria();
$this->compareAttributes($filterCriteria);
$criteria->mergeWith($filterCriteria);
$criteria->with = array();
// No joins necessary!
$sort = new SmartSort(get_class($this), isset($this->uid) ? $this->uid : get_class($this));
$sort->multiSort = false;
$sort->attributes = $this->getSort();
$sort->defaultOrder = 't.lastUpdated DESC, t.id DESC';
if ($pageSize === null) {
if (!Yii::app()->user->isGuest) {
$pageSize = Profile::getResultsPerPage();
} else {
$pageSize = 20;
}
}
$dataProvider = new SmartActiveDataProvider(get_class($this), array('sort' => $sort, 'pagination' => array('pageSize' => $pageSize), 'criteria' => $criteria, 'uid' => $this->uid, 'dbPersistentGridSettings' => $this->dbPersistentGridSettings, 'disablePersistentGridSettings' => $this->disablePersistentGridSettings));
$sort->applyOrder($criteria);
return $dataProvider;
}
示例6: campaignDataProvider
/**
* Return a SQL data provider for a list of emails in a campaign
* includes associated contact info with each email
* @return CSqlDataProvider
*/
public function campaignDataProvider($pageSize = null)
{
$criteria = X2Model::model('Campaign')->getAccessCriteria();
$conditions = $criteria->condition;
$params = array('listId' => $this->id);
$count = Yii::app()->db->createCommand()->select('count(*)')->from(X2ListItem::model()->tableName() . ' as list')->leftJoin(X2Model::model($this->modelName)->tableName() . ' t', 'list.contactId=t.id')->where('list.listId=:listId AND (' . $conditions . ')', array_merge(array(':listId' => $this->id), $criteria->params))->queryScalar();
$sql = Yii::app()->db->createCommand()->select('list.*, t.*')->from(X2ListItem::model()->tableName() . ' as list')->leftJoin(X2Model::model($this->modelName)->tableName() . ' t', 'list.contactId=t.id')->where('list.listId=:listId AND (' . $conditions . ')')->getText();
return new CSqlDataProvider($sql, array('params' => array_merge($params, $criteria->params), 'totalItemCount' => $count, 'pagination' => array('pageSize' => !empty($pageSize) ? $pageSize : Profile::getResultsPerPage()), 'sort' => array('attributes' => array('name', 'email', 'phone', 'address', 'sent', 'opened', 'clicked', 'unsubscribed', 'doNotEmail'), 'defaultOrder' => 'opened DESC, sent DESC, name DESC')));
}
示例7: getResultsPerPage
public function getResultsPerPage()
{
if (!isset($this->_resultsPerPage)) {
$this->_resultsPerPage = Profile::getResultsPerPage();
}
return $this->_resultsPerPage;
}
示例8: searchInvoice
public function searchInvoice()
{
$criteria = new CDbCriteria();
$parameters = array('limit' => ceil(Profile::getResultsPerPage()));
$criteria->scopes = array('findAll' => array($parameters));
$criteria->addCondition("t.type='invoice'");
return $this->searchBase($criteria);
}
示例9: search
/**
* Retrieves a list of models based on the current search/filter conditions.
* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
*/
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria();
$parameters = array('limit' => ceil(Profile::getResultsPerPage()));
$criteria->scopes = array('findAll' => array($parameters));
$criteria->compare('id', $this->id);
$criteria->compare('type', $this->type, true);
$criteria->compare('itemId', $this->itemId);
$criteria->compare('changedBy', $this->changedBy, true);
$criteria->compare('recordName', $this->recordName, true);
$criteria->compare('fieldName', $this->fieldName, true);
$criteria->compare('oldValue', $this->oldValue, true);
$criteria->compare('newValue', $this->newValue, true);
$criteria->compare('diff', $this->diff, true);
$criteria->compare('timestamp', $this->timestamp);
return new SmartActiveDataProvider(get_class($this), array('sort' => array('defaultOrder' => 'timestamp DESC'), 'pagination' => array('pageSize' => Profile::getResultsPerPage()), 'criteria' => $criteria));
}
示例10: actionLists
public function actionLists()
{
$filter = new X2List('search');
$criteria = new CDbCriteria();
$criteria->addCondition('type="static" OR type="dynamic"');
if (!Yii::app()->params->isAdmin) {
$condition = 'visibility="1" OR assignedTo="Anyone" OR
assignedTo="' . Yii::app()->user->getName() . '"';
/* x2temp */
$groupLinks = Yii::app()->db->createCommand()->select('groupId')->from('x2_group_to_user')->where('userId=' . Yii::app()->user->getId())->queryColumn();
if (!empty($groupLinks)) {
$condition .= ' OR assignedTo IN (' . implode(',', $groupLinks) . ')';
}
$condition .= 'OR (visibility=2 AND assignedTo IN
(SELECT username FROM x2_group_to_user WHERE groupId IN
(SELECT groupId
FROM x2_group_to_user
WHERE userId=' . Yii::app()->user->getId() . ')
)
)';
$criteria->addCondition($condition);
}
$perPage = Profile::getResultsPerPage();
//$criteria->offset = isset($_GET['page']) ? $_GET['page'] * $perPage - 3 : -3;
//$criteria->limit = $perPage;
$criteria->order = 'createDate DESC';
$filter->compareAttributes($criteria);
$contactLists = X2Model::model('X2List')->findAll($criteria);
$totalContacts = X2Model::model('Contacts')->count();
$totalMyContacts = X2Model::model('Contacts')->count('assignedTo="' . Yii::app()->user->getName() . '"');
$totalNewContacts = X2Model::model('Contacts')->count('assignedTo="' . Yii::app()->user->getName() . '" AND createDate >= ' . mktime(0, 0, 0));
$allContacts = new X2List();
$allContacts->attributes = array('id' => 'all', 'name' => Yii::t('contacts', 'All {module}', array('{module}' => Modules::displayName())), 'description' => '', 'type' => 'dynamic', 'visibility' => 1, 'count' => $totalContacts, 'createDate' => 0, 'lastUpdated' => 0);
$newContacts = new X2List();
$newContacts->attributes = array('id' => 'new', 'assignedTo' => Yii::app()->user->getName(), 'name' => Yii::t('contacts', 'New {module}', array('{module}' => Modules::displayName())), 'description' => '', 'type' => 'dynamic', 'visibility' => 1, 'count' => $totalNewContacts, 'createDate' => 0, 'lastUpdated' => 0);
$myContacts = new X2List();
$myContacts->attributes = array('id' => 'my', 'assignedTo' => Yii::app()->user->getName(), 'name' => Yii::t('contacts', 'My {module}', array('{module}' => Modules::displayName())), 'description' => '', 'type' => 'dynamic', 'visibility' => 1, 'count' => $totalMyContacts, 'createDate' => 0, 'lastUpdated' => 0);
$contactListData = array($allContacts, $myContacts, $newContacts);
$filteredPseudoLists = $filter->filter($contactListData);
$lists = array_merge($filteredPseudoLists, $contactLists);
$dataProvider = new CArrayDataProvider($lists, array('pagination' => array('pageSize' => $perPage), 'sort' => array('attributes' => array('name', 'type' => array('asc' => 'type asc, id desc', 'desc' => 'type desc, id desc'), 'count' => array('asc' => 'count asc, id desc', 'desc' => 'count desc, id desc'), 'assignedTo' => array('asc' => 'assignedTo asc, id desc', 'desc' => 'assignedTo desc, id desc'))), 'totalItemCount' => count($contactLists) + 3));
$this->render('listIndex', array('contactLists' => $dataProvider, 'filter' => $filter));
}
示例11: array
<?php
}
?>
<div style="margin-top: 23px;">
<?php
if (isset($contactList) && $model->launchDate) {
//these columns will be passed to gridview, depending on the campaign type
$displayColumns = array(array('name' => 'name', 'header' => Yii::t('contacts', 'Name'), 'headerHtmlOptions' => array('style' => 'width: 15%;'), 'value' => 'CHtml::link($data["firstName"] . " " . $data["lastName"],array("/contacts/contacts/view","id"=>$data["id"]))', 'type' => 'raw'));
if ($model->type == 'Email' && $contactList->type == 'campaign') {
$displayColumns = array_merge($displayColumns, array(array('name' => 'email', 'header' => Yii::t('contacts', 'Email'), 'headerHtmlOptions' => array('style' => 'width: 20%;'), 'value' => '!empty($data["email"]) ?
$data["email"] : (!empty($data["emailAddress"]) ? $data["emailAddress"] : "")'), array('name' => 'sent', 'header' => Yii::t('marketing', 'Sent') . ': ' . $contactList->statusCount('sent'), 'class' => 'CCheckBoxColumn', 'checked' => '$data["sent"] > 0', 'selectableRows' => 0, 'htmlOptions' => array('style' => 'text-align: center;'), 'headerHtmlOptions' => array('style' => 'width: 7%;', 'title' => $contactList->statusCount('sent'))), array('name' => 'opened', 'value' => '$data["opened"]', 'header' => Yii::t('marketing', 'Opened') . ': ' . $contactList->statusCount('opened'), 'class' => 'CDataColumn', 'type' => 'raw', 'value' => 'CHtml::checkbox(
"", $data["opened"] != 0, array("onclick"=>"return false;"))', 'htmlOptions' => array('style' => 'text-align: center;'), 'headerHtmlOptions' => array('style' => 'width: 7%;', 'title' => $contactList->statusCount('opened'))), array('name' => 'clicked', 'header' => Yii::t('marketing', 'Clicked') . ': ' . $contactList->statusCount('clicked'), 'class' => 'CCheckBoxColumn', 'checked' => '$data["clicked"] != 0', 'selectableRows' => 0, 'htmlOptions' => array('style' => 'text-align: center;'), 'headerHtmlOptions' => array('style' => 'width: 7%;')), array('name' => 'unsubscribed', 'header' => Yii::t('marketing', 'Unsubscribed') . ': ' . $contactList->statusCount('unsubscribed'), 'class' => 'CCheckBoxColumn', 'checked' => '$data["unsubscribed"] != 0', 'selectableRows' => 0, 'htmlOptions' => array('style' => 'text-align: center;'), 'headerHtmlOptions' => array('style' => 'width: 9%;', 'title' => $contactList->statusCount('unsubscribed'))), array('name' => 'doNotEmail', 'header' => Yii::t('contacts', 'Do Not Email'), 'class' => 'CCheckBoxColumn', 'checked' => '$data["doNotEmail"] == 1', 'selectableRows' => 0, 'htmlOptions' => array('style' => 'text-align: center;'), 'headerHtmlOptions' => array('style' => 'width: 7%;'))));
} elseif ($model->type == 'Call List') {
$displayColumns = array_merge($displayColumns, array(array('name' => 'phone', 'header' => Yii::t('contacts', 'Phone'), 'headerHtmlOptions' => array('style' => 'width: 10%;'))));
} elseif ($model->type == 'Physical Mail') {
$displayColumns = array_merge($displayColumns, array(array('name' => 'address', 'header' => Yii::t('contacts', 'Address'), 'headerHtmlOptions' => array('style' => 'width: 25%;'), 'value' => '$data["address"]." ".$data["address2"]." ".$data["city"]."' . ' ".$data["state"]." ".$data["zipcode"]." ".$data["country"]')));
}
?>
<div class='x2-layout-island'>
<?php
$this->widget('X2GridViewGeneric', array('defaultGvSettings' => array('name' => 140, 'email' => 140, 'opened' => 80, 'clicked' => 80, 'unsubscribed' => 80, 'doNotEmail' => 80, 'sent' => 80), 'id' => 'campaign-grid', 'template' => '<div class="page-title">{title}' . '{buttons}{summary}</div>{items}{pager}', 'buttons' => array('autoResize'), 'dataProvider' => $contactList->campaignDataProvider(Profile::getResultsPerPage()), 'columns' => $displayColumns, 'enablePagination' => true, 'gvSettingsName' => 'campaignProgressGrid'));
}
?>
</div>
</div>
</div>
<?php
$this->widget('X2WidgetList', array('layoutManager' => $layoutManager, 'block' => 'center', 'model' => $model, 'modelType' => 'Marketing'));
示例12: actionViewNotifications
/**
* View all notifications for the current web user.
*/
public function actionViewNotifications()
{
$pageSize = Profile::getResultsPerPage();
$dataProvider = new CActiveDataProvider('Notification', array('criteria' => array('condition' => 'user="' . Yii::app()->user->name . '"'), 'pagination' => array('pageSize' => $pageSize), 'sort' => array('defaultOrder' => 'createDate DESC')));
$this->render('viewNotifications', array('dataProvider' => $dataProvider));
}
示例13: actionTriggerLogs
public function actionTriggerLogs($pageSize = null)
{
$triggerLogsDataProvider = new CActiveDataProvider('TriggerLog', array('criteria' => array('order' => 'triggeredAt DESC'), 'pagination' => array('pageSize' => !empty($pageSize) ? $pageSize : Profile::getResultsPerPage())));
$viewParams['triggerLogsDataProvider'] = $triggerLogsDataProvider;
$this->render('triggerLogs', array('triggerLogsDataProvider' => $triggerLogsDataProvider));
}
示例14: searchBase
public function searchBase($criteria, $pageSize = null, $showHidden = false)
{
if ($pageSize === null) {
$pageSize = Profile::getResultsPerPage();
}
$this->compareAttributes($criteria);
/*$criteria->with = 'actionText';
$criteria->compare('actionText.text', $this->actionDescriptionTemp, true);*/
if (!empty($criteria->order)) {
$criteria->order = $order = "sticky DESC, " . $criteria->order;
} else {
$order = 'sticky DESC, IF(
complete="No", IFNULL(dueDate, IFNULL(createDate,0)),
GREATEST(createDate, IFNULL(completeDate,0), IFNULL(lastUpdated,0))) DESC';
}
$dataProvider = new SmartActiveDataProvider('Actions', array('sort' => array('defaultOrder' => $order), 'pagination' => array('pageSize' => $pageSize), 'criteria' => $criteria, 'uid' => $this->uid, 'dbPersistentGridSettings' => $this->dbPersistentGridSettings));
return $dataProvider;
}
示例15: search
public function search($resultsPerPage = null, $uniqueId = null)
{
$criteria = new CDbCriteria();
$parameters = array('limit' => ceil(Profile::getResultsPerPage()));
$criteria->scopes = array('findAll' => array($parameters));
// allows converted leads to be filtered out of grid by default
$filters = $this->asa('ERememberFiltersBehavior')->getSetting('filters');
if (!isset($filters['converted'])) {
$this->converted = 'false';
} elseif ($filters['converted'] === 'all') {
unset($this->converted);
}
return $this->searchBase($criteria, $resultsPerPage);
}