本文整理汇总了PHP中Vtiger_Paging_Model类的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Paging_Model类的具体用法?PHP Vtiger_Paging_Model怎么用?PHP Vtiger_Paging_Model使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vtiger_Paging_Model类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$moduleName = $request->getModule();
$page = $request->get('page');
$linkId = $request->get('linkid');
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $page);
$pagingModel->set('limit', 10);
$user = $request->get('type');
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$overDueActivities = $moduleModel->getCalendarActivities('overdue', $pagingModel, $user);
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
$viewer = $this->getViewer($request);
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('ACTIVITIES', $overDueActivities);
$viewer->assign('PAGING', $pagingModel);
$viewer->assign('CURRENTUSER', $currentUser);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/CalendarActivitiesContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/CalendarActivities.tpl', $moduleName);
}
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:26,代码来源:OverdueActivities.php
示例2: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$number = $request->get('number');
$page = $request->get('page');
$linkId = $request->get('linkid');
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
$limit = (int) $widget->get('limit');
if (empty($limit)) {
$limit = 10;
}
if (empty($page)) {
$page = 1;
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $page);
$pagingModel->set('limit', $limit);
$columnList = array('LBL_NAME' => 'label', 'LBL_MODULE_NAME' => 'setype', 'Last Modified By' => 'modifiedtime', 'LBL_OWNER' => 'smownerid');
$recordList = ListUpdatedRecord::getListRecord(NULL, $columnList);
$viewer->assign('COLUMN_LIST', $columnList);
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('LIST', $recordList);
$viewer->assign('PAGE', $page);
$viewer->assign('NEXTPAGE', count($recordList) < $limit ? 0 : $page + 1);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/ListUpdatedRecordContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/ListUpdatedRecord.tpl', $moduleName);
}
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:34,代码来源:ListUpdatedRecord.php
示例3: initializeListViewContents
public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
{
global $log;
$log->debug("Entering ./views/FindDuplicates.php::initializeListViewContents");
$currentUser = vglobal('current_user');
$viewer = $this->getViewer($request);
$module = $request->getModule();
$moduleModel = Vtiger_Module_Model::getInstance($module);
$massActionLink = array('linktype' => 'LISTVIEWBASIC', 'linklabel' => 'LBL_DELETE', 'linkurl' => 'Javascript:Vtiger_FindDuplicates_Js.massDeleteRecords("index.php?module=' . $module . '&action=MassDelete");', 'linkicon' => '');
$massActionLinks[] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
$viewer->assign('LISTVIEW_LINKS', $massActionLinks);
$viewer->assign('MODULE_MODEL', $moduleModel);
$pageNumber = $request->get('page');
if (empty($pageNumber)) {
$pageNumber = '1';
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$pageLimit = $pagingModel->getPageLimit();
$duplicateSearchFields = $request->get('fields');
$dataModelInstance = Vtiger_FindDuplicate_Model::getInstance($module);
$dataModelInstance->set('fields', $duplicateSearchFields);
$ignoreEmpty = $request->get('ignoreEmpty');
$ignoreEmptyValue = false;
if ($ignoreEmpty == 'on' || $ignoreEmpty == 'true' || $ignoreEmpty == '1') {
$ignoreEmptyValue = true;
}
$dataModelInstance->set('ignoreEmpty', $ignoreEmptyValue);
if (!$this->listViewEntries) {
$this->listViewEntries = $dataModelInstance->getListViewEntries($pagingModel);
}
if (!$this->listViewHeaders) {
$this->listViewHeaders = $dataModelInstance->getListViewHeaders();
}
if (!$this->rows) {
$this->rows = $dataModelInstance->getRecordCount();
$viewer->assign('TOTAL_COUNT', $this->rows);
}
$rowCount = 0;
foreach ($this->listViewEntries as $group) {
foreach ($group as $row) {
$rowCount++;
}
}
//for calculating the page range
for ($i = 0; $i < $rowCount; $i++) {
$dummyListEntries[] = $i;
}
$pagingModel->calculatePageRange($dummyListEntries);
$viewer->assign('IGNORE_EMPTY', $ignoreEmpty);
$viewer->assign('LISTVIEW_ENTRIES_COUNT', $rowCount);
$viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
$viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
$viewer->assign('PAGING_MODEL', $pagingModel);
$viewer->assign('PAGE_NUMBER', $pageNumber);
$viewer->assign('MODULE', $module);
$viewer->assign('DUPLICATE_SEARCH_FIELDS', $duplicateSearchFields);
$customViewModel = CustomView_Record_Model::getAllFilterByModule($module);
$viewer->assign('VIEW_NAME', $customViewModel->getId());
}
开发者ID:cin-system,项目名称:cinrepo,代码行数:60,代码来源:FindDuplicates.php
示例4: getListViewEntries
/**
* Function to get the list view entries
* @param Vtiger_Paging_Model $pagingModel
* @return <Array> - Associative array of record id mapped to Vtiger_Record_Model instance.
*/
public function getListViewEntries($pagingModel)
{
$db = PearDatabase::getInstance();
$moduleName = $this->getModule()->get('name');
$moduleFocus = CRMEntity::getInstance($moduleName);
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$queryGenerator = $this->get('query_generator');
$listViewContoller = $this->get('listview_controller');
$listQuery = $queryGenerator->getQuery();
$startIndex = $pagingModel->getStartIndex();
$pageLimit = $pagingModel->getPageLimit();
$importedRecordIds = $this->getLastImportedRecord();
$listViewRecordModels = array();
if (count($importedRecordIds) != 0) {
$moduleModel = $this->get('module');
$listQuery .= ' AND ' . $moduleModel->basetable . '.' . $moduleModel->basetableid . ' IN (' . implode(',', $importedRecordIds) . ')';
$listQuery .= " LIMIT {$startIndex}, {$pageLimit}";
$listResult = $db->pquery($listQuery, array());
$listViewEntries = $listViewContoller->getListViewRecords($moduleFocus, $moduleName, $listResult);
$pagingModel->calculatePageRange($listViewEntries);
foreach ($listViewEntries as $recordId => $record) {
$record['id'] = $recordId;
$listViewRecordModels[$recordId] = $moduleModel->getRecordFromArray($record);
}
}
return $listViewRecordModels;
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:32,代码来源:ListView.php
示例5: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$page = $request->get('page');
$linkId = $request->get('linkid');
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
if (!$request->has('owner')) {
$owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget);
} else {
$owner = $request->get('owner');
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $page);
$pagingModel->set('limit', (int) $widget->get('limit'));
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('PAGING', $pagingModel);
$viewer->assign('CURRENTUSER', $currentUser);
$title_max_length = vglobal('title_max_length');
$href_max_length = vglobal('href_max_length');
$viewer->assign('NAMELENGHT', $title_max_length);
$viewer->assign('HREFNAMELENGHT', $href_max_length);
$viewer->assign('NODATAMSGLABLE', 'LBL_NO_SCHEDULED_ACTIVITIES');
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$viewer->assign('CURRENT_USER', $currentUserModel);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/CalendarContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/Calendar.tpl', $moduleName);
}
}
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:34,代码来源:Calendar.php
示例6: process
public function process(Vtiger_Request $request)
{
$LIMIT = 10;
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$type = $request->get('type');
$page = $request->get('page');
$linkId = $request->get('linkid');
if (empty($page)) {
$page = 1;
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $page);
$pagingModel->set('limit', $LIMIT);
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$history = $moduleModel->getHistory($pagingModel, $type);
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
$modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('HISTORIES', $history);
$viewer->assign('PAGE', $page);
$viewer->assign('NEXTPAGE', count($history) < $LIMIT ? 0 : $page + 1);
$viewer->assign('COMMENTS_MODULE_MODEL', $modCommentsModel);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/HistoryContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/History.tpl', $moduleName);
}
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:32,代码来源:History.php
示例7: process
public function process(Vtiger_Request $request)
{
$mode = $request->getMode();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$record = $request->get('record');
$reportModel = Reports_Record_Model::getInstanceById($record);
$reportModel->setModule('Reports');
$reportModel->set('advancedFilter', $request->get('advanced_filter'));
$page = $request->get('page');
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $page);
$pagingModel->set('limit', Reports_Detail_View::REPORT_LIMIT);
if ($mode === 'save') {
$reportModel->saveAdvancedFilters();
$reportData = $reportModel->getReportData($pagingModel);
$data = $reportData['data'];
} else {
if ($mode === 'generate') {
$reportData = $reportModel->generateData($pagingModel);
$data = $reportData['data'];
}
}
$calculation = $reportModel->generateCalculationData();
$viewer->assign('PRIMARY_MODULE', $reportModel->getPrimaryModule());
$viewer->assign('CALCULATION_FIELDS', $calculation);
$viewer->assign('DATA', $data);
$viewer->assign('RECORD_ID', $record);
$viewer->assign('PAGING_MODEL', $pagingModel);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('NEW_COUNT', $reportData['count']);
$viewer->assign('REPORT_RUN_INSTANCE', ReportRun::getInstance($record));
$viewer->view('ReportContents.tpl', $moduleName);
}
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:34,代码来源:SaveAjax.php
示例8: getListViewEntries
/**
* Function to get the list view entries
* @param Vtiger_Paging_Model $pagingModel
* @return <Array> - Associative array of record id mapped to Vtiger_Record_Model instance.
*/
public function getListViewEntries($pagingModel)
{
$db = PearDatabase::getInstance();
$startIndex = $pagingModel->getStartIndex();
$pageLimit = $pagingModel->getPageLimit();
$orderBy = $this->getForSql('orderby');
$sortOrder = $this->getForSql('sortorder');
$listQuery = $this->getQuery();
$searchKey = $this->get('search_key');
$searchValue = $this->get('search_value');
if (!empty($searchKey) && !empty($searchValue)) {
$listQuery .= " WHERE {$searchKey} LIKE '{$searchValue}%'";
}
if ($orderBy) {
$listQuery .= " ORDER BY {$orderBy} {$sortOrder}";
}
$listQuery .= " LIMIT {$startIndex}," . ($pageLimit + 1);
$result = $db->pquery($listQuery, array());
$num_rows = $db->num_rows($result);
$listViewRecordModels = array();
for ($i = 0; $i < $num_rows; $i++) {
$recordModel = new EmailTemplates_Record_Model();
$recordModel->setModule('EmailTemplates');
$row = $db->query_result_rowdata($result, $i);
$listViewRecordModels[$row['templateid']] = $recordModel->setData($row);
}
$pagingModel->calculatePageRange($listViewRecordModels);
if ($num_rows > $pageLimit) {
array_pop($listViewRecordModels);
$pagingModel->set('nextPageExists', true);
} else {
$pagingModel->set('nextPageExists', false);
}
return $listViewRecordModels;
}
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:40,代码来源:ListView.php
示例9: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$linkId = $request->get('linkid');
$page = $request->get('page');
if (empty($page)) {
$page = 1;
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $page);
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$models = $moduleModel->getTopPotentials($pagingModel);
$moduleHeader = $moduleModel->getTopPotentialsHeader();
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('MODULE_HEADER', $moduleHeader);
$viewer->assign('MODELS', $models);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/TopPotentialsContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/TopPotentials.tpl', $moduleName);
}
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:27,代码来源:TopPotentials.php
示例10: process
function process(Vtiger_Request $request)
{
$branches = $request->get('branches');
$filter = $request->get('filter');
if (empty($branches)) {
return;
}
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$treeViewModel = Vtiger_TreeView_Model::getInstance($moduleModel);
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('limit', 'no_limit');
$listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $filter);
$listViewModel->set('search_params', $treeViewModel->getSearchParams($branches));
$listEntries = $listViewModel->getListViewEntries($pagingModel, true);
if (count($listEntries) === 0) {
return;
}
$listHeaders = $listViewModel->getListViewHeaders();
$viewer->assign('ENTRIES', $listEntries);
$viewer->assign('HEADERS', $listHeaders);
$viewer->assign('MODULE', $moduleName);
$viewer->view('TreeRecords.tpl', $moduleName);
}
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:25,代码来源:TreeRecords.php
示例11: getListViewEntries
/**
* Function to get the list view entries
* @param Vtiger_Paging_Model $pagingModel
* @return <Array> - Associative array of record id mapped to Vtiger_Record_Model instance.
*/
public function getListViewEntries($pagingModel)
{
$db = PearDatabase::getInstance();
$module = $this->getModule();
$moduleName = $module->getName();
$parentModuleName = $module->getParentName();
$qualifiedModuleName = $moduleName;
if (!empty($parentModuleName)) {
$qualifiedModuleName = $parentModuleName . ':' . $qualifiedModuleName;
}
$recordModelClass = Vtiger_Loader::getComponentClassName('Model', 'Record', $qualifiedModuleName);
$listQuery = $this->getBasicListQuery();
$startIndex = $pagingModel->getStartIndex();
$pageLimit = $pagingModel->getPageLimit();
$orderBy = $this->getForSql('orderby');
if (!empty($orderBy) && $orderBy === 'smownerid') {
$fieldModel = Vtiger_Field_Model::getInstance('assigned_user_id', $moduleModel);
if ($fieldModel->getFieldDataType() == 'owner') {
$orderBy = 'COALESCE(' . getSqlForNameInDisplayFormat(['first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'], 'Users') . ',vtiger_groups.groupname)';
}
}
if (!empty($orderBy)) {
$listQuery .= ' ORDER BY ' . $orderBy . ' ' . $this->getForSql('sortorder');
}
if ($module->isPagingSupported()) {
$nextListQuery = $listQuery . ' LIMIT ' . ($startIndex + $pageLimit) . ',1';
$listQuery .= " LIMIT $startIndex, $pageLimit";
}
$listResult = $db->pquery($listQuery, array());
$noOfRecords = $db->num_rows($listResult);
$listViewRecordModels = array();
for ($i = 0; $i < $noOfRecords; ++$i) {
$row = $db->query_result_rowdata($listResult, $i);
$record = new $recordModelClass();
$record->setData($row);
if (method_exists($record, 'getModule') && method_exists($record, 'setModule')) {
$moduleModel = Settings_Vtiger_Module_Model::getInstance($qualifiedModuleName);
$record->setModule($moduleModel);
}
$listViewRecordModels[$record->getId()] = $record;
}
if ($module->isPagingSupported()) {
$pagingModel->calculatePageRange($listViewRecordModels);
$nextPageResult = $db->pquery($nextListQuery, array());
$nextPageNumRows = $db->num_rows($nextPageResult);
if ($nextPageNumRows <= 0) {
$pagingModel->set('nextPageExists', false);
}
}
return $listViewRecordModels;
}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:65,代码来源:ListView.php
示例12: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$page = $request->get('page');
$linkId = $request->get('linkid');
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
if (!$request->has('owner')) {
$owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget);
} else {
$owner = $request->get('owner');
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $page);
$pagingModel->set('limit', (int) $widget->get('limit'));
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$projectsTasks = $owner === false ? array() : $moduleModel->getAssignedProjectsTasks('upcoming', $pagingModel, $owner);
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('PROJECTSTASKS', $projectsTasks);
$viewer->assign('PAGING', $pagingModel);
$viewer->assign('CURRENTUSER', $currentUser);
global $title_max_length, $href_max_length;
$viewer->assign('NAMELENGHT', $title_max_length);
$viewer->assign('HREFNAMELENGHT', $href_max_length);
$viewer->assign('NODATAMSGLABLE', 'LBL_NO_OVERDUE_ACTIVITIES');
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/AssignedProjectsTasksContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/AssignedProjectsTasks.tpl', $moduleName);
}
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:34,代码来源:AssignedOverdueProjectsTasks.php
示例13: process
public function process(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$pageNumber = $request->get('page');
if (empty($pageNumber)) {
$pageNumber = '1';
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$pagingModel->set('viewid', $cvId);
$viewer->assign('PAGING_MODEL', $pagingModel);
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false)) {
if (!$this->listViewCount) {
$this->listViewCount = $accountListViewModel->getListViewCount();
}
$totalCount = $this->listViewCount;
$pageLimit = $pagingModel->getPageLimit();
$pageCount = ceil((int) $totalCount / (int) $pageLimit);
if ($pageCount == 0) {
$pageCount = 1;
}
$viewer->assign('PAGE_COUNT', $pageCount);
$viewer->assign('LISTVIEW_COUNT', $totalCount);
}
if (!$this->listViewEntries) {
$this->listViewEntries = $accountListViewModel->getListViewEntries($pagingModel);
}
$noOfEntries = count($this->listViewEntries);
$viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);
$viewer->view('ListViewActions.tpl', $request->getModule());
}
开发者ID:googlicius,项目名称:SP,代码行数:31,代码来源:ListViewActions.php
示例14: process
function process(Vtiger_Request $request)
{
$branches = $request->get('branches');
$filter = $request->get('filter');
if (empty($branches)) {
return;
}
$moduleName = $request->getModule();
$viewer = $this->getViewer($request);
$baseModuleName = 'Accounts';
$multiReferenceFirld = Vtiger_MultiReferenceValue_UIType::getFieldsByModules($baseModuleName, $moduleName);
if (count($multiReferenceFirld) === 0) {
return;
}
$multiReferenceFirld = reset($multiReferenceFirld);
$searchParams = [['columns' => [['columnname' => $multiReferenceFirld['tablename'] . ':' . $multiReferenceFirld['columnname'] . ':' . $multiReferenceFirld['fieldname'], 'value' => implode(',', $branches), 'column_condition' => '', 'comparator' => 'c']]]];
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('limit', 'no_limit');
$listViewModel = Vtiger_ListView_Model::getInstance($baseModuleName, $filter);
$listViewModel->set('search_key', $multiReferenceFirld['fieldname']);
$listViewModel->set('search_params', $searchParams);
$listEntries = $listViewModel->getListViewEntries($pagingModel, true);
if (count($listEntries) === 0) {
return;
}
$listHeaders = $listViewModel->getListViewHeaders();
$viewer->assign('ENTRIES', $listEntries);
$viewer->assign('HEADERS', $listHeaders);
$viewer->assign('MODULE', $baseModuleName);
$viewer->view('TreeRecords.tpl', $moduleName);
}
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:31,代码来源:TreeRecords.php
示例15: getActivities
/**
* Function to get activities
* @param Vtiger_Request $request
* @return <List of activity models>
*/
public function getActivities(Vtiger_Request $request)
{
$moduleName = 'Calendar';
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
if ($currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) {
$moduleName = $request->getModule();
$recordId = $request->get('record');
$pageNumber = $request->get('page');
if (empty($pageNumber)) {
$pageNumber = 1;
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$pagingModel->set('limit', 10);
if (!$this->record) {
$this->record = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
}
$recordModel = $this->record->getRecord();
$moduleModel = $recordModel->getModule();
$relatedActivities = $moduleModel->getCalendarActivities('', $pagingModel, 'all', $recordId);
$viewer = $this->getViewer($request);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('PAGING_MODEL', $pagingModel);
$viewer->assign('PAGE_NUMBER', $pageNumber);
$viewer->assign('ACTIVITIES', $relatedActivities);
return $viewer->view('RelatedActivities.tpl', $moduleName, true);
}
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:35,代码来源:Detail.php
示例16: getPagination
public function getPagination(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$pageNumber = $request->get('page');
$searchResult = $request->get('searchResult');
$moduleName = $request->getModule();
$listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $cvId);
if (empty($pageNumber)) {
$pageNumber = '1';
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$pagingModel->set('viewid', $request->get('viewname'));
$searchKey = $request->get('search_key');
$searchValue = $request->get('search_value');
$operator = $request->get('operator');
if (!empty($operator)) {
$listViewModel->set('operator', $operator);
$viewer->assign('OPERATOR', $operator);
$viewer->assign('ALPHABET_VALUE', $searchValue);
}
if (!empty($searchKey) && !empty($searchValue)) {
$listViewModel->set('search_key', $searchKey);
$listViewModel->set('search_value', $searchValue);
}
$searchParmams = $request->get('search_params');
if (empty($searchParmams) || !is_array($searchParmams)) {
$searchParmams = [];
}
$transformedSearchParams = $this->transferListSearchParamsToFilterCondition($searchParmams, $listViewModel->getModule());
$listViewModel->set('search_params', $transformedSearchParams);
if (!$this->listViewEntries) {
$this->listViewEntries = $listViewModel->getListViewEntries($pagingModel, $searchResult);
}
if (!$this->listViewCount) {
$this->listViewCount = $listViewModel->getListViewCount();
}
$noOfEntries = count($this->listViewEntries);
$totalCount = $this->listViewCount;
$pageLimit = $pagingModel->getPageLimit();
$pageCount = ceil((int) $totalCount / (int) $pageLimit);
if ($pageCount == 0) {
$pageCount = 1;
}
$viewer->assign('PAGE_COUNT', $pageCount);
$startPaginFrom = $pageNumber - 2;
if ($pageNumber == $totalCount && 1 != $pageNumber) {
$startPaginFrom = $pageNumber - 4;
}
if ($startPaginFrom <= 0 || 1 == $pageNumber) {
$startPaginFrom = 1;
}
$viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);
$viewer->assign('PAGE_NUMBER', $pageNumber);
$viewer->assign('LISTVIEW_COUNT', $totalCount);
$viewer->assign('START_PAGIN_FROM', $startPaginFrom);
$viewer->assign('PAGING_MODEL', $pagingModel);
echo $viewer->view('Pagination.tpl', $moduleName, true);
}
开发者ID:noclav,项目名称:UpdatePackages,代码行数:59,代码来源:Pagination.php
示例17: initializeListViewContents
public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
{
$moduleName = $request->getModule();
$pageNumber = $request->get('page');
$orderBy = $request->get('orderby');
$sortOrder = $request->get('sortorder');
$searchValue = $request->get('search_value');
/* if(empty($orderBy) && empty($searchValue) && empty($pageNumber)) {
$orderParams = Vtiger_ListView_Model::getSortParamsSession($moduleName);
if($orderParams) {
$pageNumber = $orderParams['page'];
$orderBy = $orderParams['orderby'];
$sortOrder = $orderParams['sortorder'];
$searchValue = $orderParams['search_value'];
}
} else {
$params = array('page' => $pageNumber, 'orderby' => $orderBy, 'sortorder' => $sortOrder, 'search_value' => $searchValue);
Vtiger_ListView_Model::setSortParamsSession($moduleName, $params);
} */
if ($sortOrder == "ASC") {
$nextSortOrder = "DESC";
$sortImage = "glyphicon glyphicon-chevron-down";
} else {
$nextSortOrder = "ASC";
$sortImage = "glyphicon glyphicon-chevron-up";
}
if (empty($pageNumber)) {
$pageNumber = '1';
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$listViewModel = new Portal_ListView_Model();
if (!empty($orderBy)) {
$listViewModel->set('orderby', $orderBy);
$listViewModel->set('sortorder', $sortOrder);
}
if (!empty($searchValue)) {
$listViewModel->set('search_value', $searchValue);
}
$listviewEntries = $listViewModel->getListViewEntries($pagingModel);
$pagingInfo = $listViewModel->calculatePageRange($listviewEntries, $pagingModel);
$pagingModel->set('totalCount', $pagingInfo['recordCount']);
$pageCount = $pagingModel->getPageCount();
$startPaginFrom = $pagingModel->getStartPagingFrom();
$viewer->assign('PAGE_NUMBER', $pageNumber);
$viewer->assign('PAGE_COUNT', $pageCount);
$viewer->assign('LISTVIEW_COUNT', $pagingInfo['recordCount']);
$viewer->assign('START_PAGIN_FROM', $startPaginFrom);
$viewer->assign('PAGING_MODEL', $pagingModel);
$viewer->assign('LISTVIEW_ENTRIES', $listviewEntries);
$viewer->assign('ALPHABET_VALUE', $searchValue);
$viewer->assign('COLUMN_NAME', $orderBy);
$viewer->assign('SORT_ORDER', $sortOrder);
$viewer->assign('SORT_IMAGE', $sortImage);
$viewer->assign('NEXT_SORT_ORDER', $nextSortOrder);
$viewer->assign('RECORD_COUNT', count($listviewEntries));
$viewer->assign('CURRENT_PAGE', $pageNumber);
$viewer->assign('PAGING_INFO', $pagingInfo);
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:59,代码来源:List.php
示例18: getPagination
public function getPagination(Vtiger_Request $request)
{
parent::preProcess($request, false);
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$folders = $moduleModel->getFolders();
$listViewModel = new Reports_ListView_Model();
$listViewModel->set('module', $moduleModel);
$folderId = $request->get('viewname');
if (empty($folderId) || $folderId == 'undefined') {
$folderId = 'All';
}
$sortBy = $request->get('sortorder');
$orderBy = $request->get('orderby');
$listViewModel->set('folderid', $folderId);
$listViewModel->set('orderby', $orderBy);
$listViewModel->set('sortorder', $sortBy);
$linkModels = $listViewModel->getListViewLinks();
$pageNumber = $request->get('page');
$listViewMassActionModels = $listViewModel->getListViewMassActions();
if (empty($pageNumber)) {
$pageNumber = '1';
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$viewer->assign('PAGING_MODEL', $pagingModel);
if (!$this->listViewHeaders) {
$this->listViewHeaders = $listViewModel->getListViewHeaders();
}
if (!$this->listViewEntries) {
$this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
}
$noOfEntries = count($this->listViewEntries);
$viewer->assign('LISTVIEW_LINKS', $linkModels);
$viewer->assign('FOLDERS', $folders);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('VIEWNAME', $folderId);
$viewer->assign('PAGE_NUMBER', $pageNumber);
$viewer->assign('LISTVIEW_MASSACTIONS', $listViewMassActionModels);
$viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);
if (!$this->listViewCount) {
$this->listViewCount = $listViewModel->getListViewCount();
}
$totalCount = $this->listViewCount;
$pagingModel->set('totalCount', (int) $totalCount);
$pageCount = $pagingModel->getPageCount();
$startPaginFrom = $pagingModel->getStartPagingFrom();
$viewer->assign('PAGE_COUNT', $pageCount);
$viewer->assign('LISTVIEW_COUNT', $totalCount);
$viewer->assign('START_PAGIN_FROM', $startPaginFrom);
$viewer->assign('PAGING_MODEL', $pagingModel);
echo $viewer->view('Pagination.tpl', $moduleName, true);
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:54,代码来源:Pagination.php
示例19: initializeListViewContents
public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
{
$moduleName = $request->get('for_module');
$cvId = $request->get('viewname');
$pageNumber = $request->get('page');
$orderBy = $request->get('orderby');
$sortOrder = $request->get('sortorder');
if (empty($orderBy) && empty($sortOrder)) {
$moduleInstance = CRMEntity::getInstance($moduleName);
$orderBy = $moduleInstance->default_order_by;
$sortOrder = $moduleInstance->default_sort_order;
}
if ($sortOrder == "ASC") {
$nextSortOrder = "DESC";
$sortImage = "downArrowSmall.png";
} else {
$nextSortOrder = "ASC";
$sortImage = "upArrowSmall.png";
}
if (empty($pageNumber)) {
$pageNumber = '1';
}
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$listViewModel = Import_ListView_Model::getInstance($moduleName, $cvId);
$recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
if (!empty($orderBy)) {
$listViewModel->set('orderby', $orderBy);
$listViewModel->set('sortorder', $sortOrder);
}
if (!$this->listViewHeaders) {
$this->listViewHeaders = $listViewModel->getListViewHeaders();
}
if (!$this->listViewEntries) {
$this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
}
$noOfEntries = count($this->listViewEntries);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('PAGING_MODEL', $pagingModel);
$viewer->assign('PAGE_NUMBER', $pageNumber);
$viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
$viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
$viewer->assign('ORDER_BY', $orderBy);
$viewer->assign('SORT_ORDER', $sortOrder);
$viewer->assign('NEXT_SORT_ORDER', $nextSortOrder);
$viewer->assign('SORT_IMAGE', $sortImage);
$viewer->assign('COLUMN_NAME', $orderBy);
$viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);
$viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
$viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
$viewer->assign('CURRENT_USER_MODEL', Users_Record_Model::getCurrentUserModel());
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:53,代码来源:List.php
示例20: getPagination
public function getPagination(Vtiger_Request $request)
{
parent::preProcess($request, false);
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$pageNumber = $request->get('page');
$orderBy = $request->get('orderby');
$sortOrder = $request->get('sortorder');
$searchValue = $request->get('search_value');
if ($sortOrder == "ASC") {
$nextSortOrder = "DESC";
$sortImage = "glyphicon glyphicon-chevron-down";
} else {
$nextSortOrder = "ASC";
$sortImage = "glyphicon glyphicon-chevron-up";
}
if (empty($pageNumber)) {
$pageNumber = '1';
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$listViewModel = new Portal_ListView_Model();
if (!empty($orderBy)) {
$listViewModel->set('orderby', $orderBy);
$listViewModel->set('sortorder', $sortOrder);
}
if (!empty($searchValue)) {
$listViewModel->set('search_value', $searchValue);
}
$listviewEntries = $listViewModel->getListViewEntries($pagingModel);
$pagingInfo = $listViewModel->calculatePageRange($listviewEntries, $pagingModel);
$pagingModel->set('totalCount', $pagingInfo['recordCount']);
$pageCount = $pagingModel->getPageCount();
$startPaginFrom = $pagingModel->getStartPagingFrom();
$viewer->assign('PAGE_NUMBER', $pageNumber);
$viewer->assign('PAGE_COUNT', $pageCount);
|
请发表评论