本文整理汇总了PHP中Vtiger_Paging_Model::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Paging_Model::set方法的具体用法?PHP Vtiger_Paging_Model::set怎么用?PHP Vtiger_Paging_Model::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Paging_Model
的用法示例。
在下文中一共展示了Vtiger_Paging_Model::set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: 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);
}
示例3: 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);
}
}
示例4: 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);
}
}
示例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'));
$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);
}
}
示例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);
}
}
示例7: 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());
}
示例8: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$stateActivityLabels = Calendar_Module_Model::getComponentActivityStateLabel();
$page = $request->get('page');
$linkId = $request->get('linkid');
$sortOrder = $request->get('sortorder');
$orderBy = $request->get('orderby');
$params = ['status' => $stateActivityLabels['in_realization']];
if ($request->get('switchParams')) {
$params = ['status' => $request->get('switchParams')];
}
$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'));
$pagingModel->set('orderby', $orderBy);
$pagingModel->set('sortorder', $sortOrder);
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$calendarActivities = ($owner === false) ? array() : $moduleModel->getCalendarActivities('upcoming', $pagingModel, $owner, false, $params);
$switchLabels = [];
$switchLabels[] = ['label' => vtranslate($stateActivityLabels['in_realization'], 'Calendar'), 'name' => $stateActivityLabels['in_realization']];
$switchLabels[] = ['label' => vtranslate($stateActivityLabels['not_started'], 'Calendar'), 'name' => $stateActivityLabels['not_started']];
$msgLabel = 'LBL_NO_SCHEDULED_ACTIVITIES';
if ($params['status'] == $stateActivityLabels['in_realization']) {
$msgLabel = 'LBL_NO_CURRENT_ACTIVITIES';
}
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('ACTIVITIES', $calendarActivities);
$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('OWNER', $owner);
$viewer->assign('HREFNAMELENGHT', $href_max_length);
$viewer->assign('NODATAMSGLABLE', $msgLabel);
$viewer->assign('SWITCH', $switchLabels);
$viewer->assign('LISTVIEWLINKS', true);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/CalendarActivitiesContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/CalendarActivities.tpl', $moduleName);
}
}
示例9: 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);
}
}
示例10: 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);
}
示例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);
$listFields = $module->listFields;
$listQuery = "SELECT ";
foreach ($listFields as $fieldName => $fieldLabel) {
$listQuery .= "{$fieldName}, ";
}
$listQuery .= $module->baseIndex . " FROM " . $module->baseTable;
$params = array();
$sourceModule = $this->get('sourceModule');
if (!empty($sourceModule)) {
$listQuery .= ' WHERE module_name = ?';
$params[] = $sourceModule;
}
$startIndex = $pagingModel->getStartIndex();
$pageLimit = $pagingModel->getPageLimit();
$orderBy = $this->getForSql('orderby');
if (!empty($orderBy)) {
$listQuery .= ' ORDER BY ' . $orderBy . ' ' . $this->getForSql('sortorder');
}
$nextListQuery = $listQuery . ' LIMIT ' . ($startIndex + $pageLimit) . ',1';
$listQuery .= " LIMIT {$startIndex}," . ($pageLimit + 1);
$listResult = $db->pquery($listQuery, $params);
$noOfRecords = $db->num_rows($listResult);
$listViewRecordModels = array();
for ($i = 0; $i < $noOfRecords; ++$i) {
$row = $db->query_result_rowdata($listResult, $i);
$record = new $recordModelClass();
$row['module_name'] = vtranslate($row['module_name'], $row['module_name']);
$row['execution_condition'] = vtranslate($record->executionConditionAsLabel($row['execution_condition']), 'Settings:Workflows');
$record->setData($row);
$listViewRecordModels[$record->getId()] = $record;
}
$pagingModel->calculatePageRange($listViewRecordModels);
if ($db->num_rows($listResult) > $pageLimit) {
array_pop($listViewRecordModels);
$pagingModel->set('nextPageExists', true);
} else {
$pagingModel->set('nextPageExists', false);
}
$nextPageResult = $db->pquery($nextListQuery, $params);
$nextPageNumRows = $db->num_rows($nextPageResult);
if ($nextPageNumRows <= 0) {
$pagingModel->set('nextPageExists', false);
}
return $listViewRecordModels;
}
示例12: 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();
$parentModuleName = $module->getParentName();
if (!empty($parentModuleName)) {
$qualifiedModuleName = $parentModuleName . ':' . $module->getName();
}
$recordModelClass = Vtiger_Loader::getComponentClassName('Model', 'Record', $qualifiedModuleName);
$listFields = $module->listFields;
$listQuery = 'SELECT ';
foreach ($listFields as $fieldName => $fieldLabel) {
$listQuery .= '`' . $fieldName . '`, ';
}
$listQuery .= '`' . $module->baseIndex . '` FROM `' . $module->baseTable . '`';
$params = [];
$sourceModule = $this->get('sourceModule');
if (!empty($sourceModule)) {
$sourceModule = Vtiger_Functions::getModuleName($sourceModule);
$listQuery .= ' WHERE `tabid` = ?';
$params[] = $sourceModule;
}
$startIndex = $pagingModel->getStartIndex();
$pageLimit = $pagingModel->getPageLimit();
$orderBy = $this->getForSql('orderby');
if (!empty($orderBy)) {
$listQuery .= ' ORDER BY ' . $orderBy . ' ' . $this->getForSql('sortorder');
}
$nextListQuery = $listQuery . ' LIMIT ' . ($startIndex + $pageLimit) . ',1';
$listQuery .= " LIMIT {$startIndex}," . ($pageLimit + 1);
$listResult = $db->pquery($listQuery, $params);
$listViewRecordModels = [];
while ($row = $db->getRow($listResult)) {
$recordModel = new $recordModelClass();
$moduleName = Vtiger_Functions::getModuleName($row['tabid']);
$relModuleName = Vtiger_Functions::getModuleName($row['reltabid']);
$row['tabid'] = vtranslate($moduleName, $moduleName);
$row['reltabid'] = vtranslate($relModuleName, $relModuleName);
$recordModel->setData($row);
$listViewRecordModels[$recordModel->getId()] = $recordModel;
}
$pagingModel->calculatePageRange($listViewRecordModels);
if ($listResult->rowCount() > $pageLimit) {
array_pop($listViewRecordModels);
$pagingModel->set('nextPageExists', true);
} else {
$pagingModel->set('nextPageExists', false);
}
$nextPageResult = $db->pquery($nextListQuery, $params);
if ($nextPageResult->rowCount() <= 0) {
$pagingModel->set('nextPageExists', false);
}
return $listViewRecordModels;
}
示例13: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$moduleName = $request->getModule();
$page = $request->get('page');
$linkId = $request->get('linkid');
$sortOrder = $request->get('sortorder');
$orderBy = $request->get('orderby');
$data = $request->getAll();
$params = ['activitesType' => 'upcoming'];
if ($request->get('activitesType')) {
$params = ['activitesType' => $request->get('activitesType')];
} else {
$data['activitesType'] = 'upcoming';
$params = ['activitesType' => 'upcoming'];
}
$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'));
$pagingModel->set('orderby', $orderBy);
$pagingModel->set('sortorder', $sortOrder);
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$overDueActivities = $owner === false ? array() : $moduleModel->getCalendarActivities('createdByMeButNotMine', $pagingModel, $owner, false, $params);
$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);
$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_RECORDS_MATCHED_THIS_CRITERIA');
$viewer->assign('OWNER', $owner);
$viewer->assign('DATA', $data);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/CalendarActivitiesContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/CreatedNotMineActivities.tpl', $moduleName);
}
}
示例14: 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();
/*убираем ненужные столбцы*/
$columns = array('SUM' => false, 'AVG' => false, 'MIN' => false, 'MAX' => false);
foreach ($calculation as $metriks) {
foreach ($metriks as $index => $metrik) {
$postfix = substr($index, -3, 3);
if ($columns[$postfix]) {
continue;
}
if (!empty($metrik)) {
$columns[$postfix] = true;
}
}
}
$viewer->assign('COLUMNS', $columns);
/*end*/
$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);
}
示例15: 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);
}
}