本文整理汇总了PHP中ListViewSession::getRequestCurrentPage方法的典型用法代码示例。如果您正苦于以下问题:PHP ListViewSession::getRequestCurrentPage方法的具体用法?PHP ListViewSession::getRequestCurrentPage怎么用?PHP ListViewSession::getRequestCurrentPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListViewSession
的用法示例。
在下文中一共展示了ListViewSession::getRequestCurrentPage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public static function render($userInputObject, $user)
{
global $list_max_entries_per_page;
$adb = PearDatabase::getInstance();
$viewer = new Import_UI_Viewer();
$ownerId = $userInputObject->get('foruser');
$owner = new Users();
$owner->id = $ownerId;
$owner->retrieve_entity_info($ownerId, 'Users');
if (!is_admin($user) && $user->id != $owner->id) {
$viewer->display('OperationNotPermitted.tpl', 'Vtiger');
exit;
}
$userDBTableName = Import_Utils::getDbTableName($owner);
$moduleName = $userInputObject->get('module');
$moduleMeta = self::getModuleMeta($moduleName, $user);
$result = $adb->query('SELECT recordid FROM ' . $userDBTableName . ' WHERE status is NOT NULL AND recordid IS NOT NULL');
$noOfRecords = $adb->num_rows($result);
$importedRecordIds = array();
for ($i = 0; $i < $noOfRecords; ++$i) {
$importedRecordIds[] = $adb->query_result($result, $i, 'recordid');
}
if (count($importedRecordIds) == 0) {
$importedRecordIds[] = 0;
}
$focus = CRMEntity::getInstance($moduleName);
$queryGenerator = new QueryGenerator($moduleName, $user);
$customView = new CustomView($moduleName);
$viewId = $customView->getViewIdByName('All', $moduleName);
$queryGenerator->initForCustomViewById($viewId);
$list_query = $queryGenerator->getQuery();
// Fetch only last imported records
$list_query .= ' AND ' . $focus->table_name . '.' . $focus->table_index . ' IN (' . implode(',', $importedRecordIds) . ')';
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
$count_result = $adb->query(mkCountQuery($list_query));
$noofrows = $adb->query_result($count_result, 0, "count");
} else {
$noofrows = null;
}
$start = ListViewSession::getRequestCurrentPage($moduleName, $list_query, $viewId, false);
$navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);
$limit_start_rec = ($start - 1) * $list_max_entries_per_page;
$list_result = $adb->pquery($list_query . " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}", array());
$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec, $noofrows);
$viewer->assign('recordListRange', $recordListRangeMsg);
$controller = new ListViewController($adb, $user, $queryGenerator);
$listview_header = $controller->getListViewHeader($focus, $moduleName, $url_string, $sorder, $order_by, true);
$listview_entries = $controller->getListViewEntries($focus, $moduleName, $list_result, $navigation_array, true);
$viewer->assign('CURRENT_PAGE', $start);
$viewer->assign('LISTHEADER', $listview_header);
$viewer->assign('LISTENTITY', $listview_entries);
$viewer->assign('FOR_MODULE', $moduleName);
$viewer->assign('FOR_USER', $ownerId);
$isAjax = $userInputObject->get('ajax');
if (!empty($isAjax)) {
echo $viewer->fetch('ListViewEntries.tpl');
} else {
$viewer->display('ImportListView.tpl');
}
}
示例2: fixPostgresQuery
}
$list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
}
}
///Postgres 8 fixes
if ($adb->dbType == "pgsql") {
$list_query = fixPostgresQuery($list_query, $log, 0);
}
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
$count_result = $adb->query(mkCountQuery($list_query));
$noofrows = $adb->query_result($count_result, 0, "count");
} else {
$noofrows = null;
}
$queryMode = isset($_REQUEST['query']) && $_REQUEST['query'] == 'true';
$start = ListViewSession::getRequestCurrentPage($currentModule, $list_query, $viewid, $queryMode);
$navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);
$limit_start_rec = ($start - 1) * $list_max_entries_per_page;
if ($adb->dbType == "pgsql") {
$list_result = $adb->pquery($list_query . " OFFSET {$limit_start_rec} LIMIT {$list_max_entries_per_page}", array());
} else {
$list_result = $adb->pquery($list_query . " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}", array());
}
$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec);
$smarty->assign('recordListRange', $recordListRangeMsg);
//Retreive the List View Table Header
if ($viewid != '') {
$url_string .= "&viewname=" . $viewid;
}
$listview_header = getListViewHeader($focus, "SalesOrder", $url_string, $sorder, $order_by, "", $oCustomView);
$smarty->assign("LISTHEADER", $listview_header);
示例3: getTranslatedString
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("MODULE", $currentModule);
$smarty->assign("SINGLE_MOD", getTranslatedString('SINGLE_' . $currentModule, $currentModule));
$smarty->assign("BUTTONS", $other_text);
$smarty->assign("NEW_EVENT", $app_strings['LNK_NEW_EVENT']);
$smarty->assign("NEW_TASK", $app_strings['LNK_NEW_TASK']);
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
$count_result = $adb->query(mkCountQuery($list_query));
$noofrows = $adb->query_result($count_result, 0, "count");
} else {
$noofrows = null;
}
$queryMode = isset($_REQUEST['query']) && $_REQUEST['query'] == 'true';
$start = ListViewSession::getRequestCurrentPage('Calendar', $list_query, $viewid, $queryMode);
$navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);
$limit_start_rec = ($start - 1) * $list_max_entries_per_page;
$list_result = $adb->pquery($list_query . " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}", array());
$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec, $noofrows);
$smarty->assign('recordListRange', $recordListRangeMsg);
//Retreive the List View Table Header
if ($viewid != '') {
$url_string .= "&viewname=" . $viewid;
}
if (!empty($viewid)) {
if (!isset($oCustomView->list_fields['Close'])) {
$oCustomView->list_fields['Close'] = array('vtiger_activity' => 'eventstatus');
}
if (!isset($oCustomView->list_fields_name['Close'])) {
$oCustomView->list_fields_name['Close'] = 'eventstatus';
示例4: getEventList
/**
* Function to get events list scheduled between specified dates
* @param array $calendar - collection of objects and strings
* @param string $start_date - date string
* @param string $end_date - date string
* @param string $info - string 'listcnt' or empty string. if 'listcnt' means it returns no. of events and no. of pending events in array format else it returns events list in array format
* return array $Entries - eventslists in array format
*/
function getEventList(&$calendar, $start_date, $end_date, $info = '')
{
global $log, $theme;
$Entries = array();
$category = getParentTab();
global $adb, $current_user, $mod_strings, $app_strings, $cal_log, $listview_max_textlength, $list_max_entries_per_page;
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
$cal_log->debug("Entering getEventList() method...");
$and = "AND (\n\t\t\t\t\t(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(CAST(CONCAT(date_start,' ',time_start) AS DATETIME) >= ? AND CAST(CONCAT(date_start,' ',time_start) AS DATETIME) <= ?)\n\t\t\t\t\t\t\tOR\t(CAST(CONCAT(due_date,' ',time_end) AS DATETIME) >= ? AND CAST(CONCAT(due_date,' ',time_end) AS DATETIME) <= ? )\n\t\t\t\t\t\t\tOR\t(CAST(CONCAT(date_start,' ',time_start) AS DATETIME) <= ? AND CAST(CONCAT(due_date,' ',time_end) AS DATETIME) >= ?)\n\t\t\t\t\t\t)\n\t\t\t\t\t\tAND vtiger_recurringevents.activityid is NULL\n\t\t\t\t\t)\n\t\t\t\tOR (\n\t\t\t\t\t\t(CAST(CONCAT(vtiger_recurringevents.recurringdate,' ',time_start) AS DATETIME) >= ?\n\t\t\t\t\t\t\tAND CAST(CONCAT(vtiger_recurringevents.recurringdate,' ',time_start) AS DATETIME) <= ?)\n\t\t\t\t\t\tOR\t(CAST(CONCAT(due_date,' ',time_end) AS DATETIME) >= ? AND CAST(CONCAT(due_date,' ',time_end) AS DATETIME) <= ?)\n\t\t\t\t\t\tOR\t(CAST(CONCAT(vtiger_recurringevents.recurringdate,' ',time_start) AS DATETIME) <= ?\n\t\t\t\t\t\t\tAND CAST(CONCAT(due_date,' ',time_end) AS DATETIME) >= ?)\n\t\t\t\t\t)\n\t\t\t\t)";
$userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
$query = "SELECT vtiger_groups.groupname, {$userNameSql} as user_name,vtiger_crmentity.smownerid, vtiger_crmentity.crmid,\n \t\tvtiger_activity.* FROM vtiger_activity\n\t\tINNER JOIN vtiger_crmentity\n\t\t\tON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\tLEFT JOIN vtiger_groups\n\t\t\tON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\tLEFT JOIN vtiger_users\n\t \t\tON vtiger_users.id = vtiger_crmentity.smownerid \n\t\tLEFT OUTER JOIN vtiger_recurringevents\n\t\t\tON vtiger_recurringevents.activityid = vtiger_activity.activityid\n\t\tWHERE vtiger_crmentity.deleted = 0\n\t\t\tAND (vtiger_activity.activitytype not in ('Emails','Task')) {$and} ";
$list_query = $query . " AND vtiger_crmentity.smownerid = " . $current_user->id;
// User Select Customization: Changes should made also in (Appointment::readAppointment)
$query_filter_prefix = calendarview_getSelectedUserFilterQuerySuffix();
$query .= $query_filter_prefix;
$count_query .= $query_filter_prefix;
// END
$startDate = new DateTimeField($start_date . ' 00:00');
$endDate = new DateTimeField($end_date . ' 23:59');
$params = $info_params = array($startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(), $startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(), $startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(), $startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(), $startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(), $startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue());
if ($info != '') {
$groupids = explode(",", fetchUserGroupids($current_user->id));
// Explode can be removed, once implode is removed from fetchUserGroupids
if (count($groupids) > 0) {
$com_q = " AND (vtiger_crmentity.smownerid = ?\n\t\t\t\t\tOR vtiger_groups.groupid in (" . generateQuestionMarks($groupids) . "))\n\t\t\t\t\tGROUP BY vtiger_activity.activityid";
} else {
$com_q = " AND vtiger_crmentity.smownerid = ?\n\t\t\t\tGROUP BY vtiger_activity.activityid";
}
$pending_query = $query . " AND (vtiger_activity.eventstatus = 'Planned')" . $com_q;
$total_q = $query . "" . $com_q;
array_push($info_params, $current_user->id);
if (count($groupids) > 0) {
array_push($info_params, $groupids);
}
$total_res = $adb->pquery($total_q, $info_params);
$total = $adb->num_rows($total_res);
$res = $adb->pquery($pending_query, $info_params);
$pending_rows = $adb->num_rows($res);
$cal_log->debug("Exiting getEventList() method...");
return array('totalevent' => $total, 'pendingevent' => $pending_rows);
}
if ($is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[16] == 3) {
$sec_parameter = getCalendarViewSecurityParameter();
$query .= $sec_parameter;
}
if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'search') {
$search_where = calendar_search_where($_REQUEST['field_name'], $_REQUEST['search_option'], $_REQUEST['search_text']);
$group_cond .= $search_where;
}
$group_cond .= " GROUP BY vtiger_activity.activityid ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC";
//Ticket 6476
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
$count_result = $adb->pquery(mkCountQuery($query), $params);
$noofrows = $adb->query_result($count_result, 0, "count");
} else {
$noofrows = null;
}
global $currentModule;
$queryMode = isset($_REQUEST['query']) && $_REQUEST['query'] == 'true';
//$viewid is used as a key for cache query and other info so pass the dates as viewid
$viewid = $start_date . $end_date;
$start = ListViewSession::getRequestCurrentPage($currentModule, $adb->convert2sql($query, $params), $viewid, $queryMode);
$navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);
//end
$start_rec = ($start - 1) * $list_max_entries_per_page;
$end_rec = $navigation_array['end_val'];
//print_r($navigation_array);die();
//echo $end_rec.'val';
$list_query = $adb->convert2Sql($query, $params);
$_SESSION['Calendar_listquery'] = $list_query;
if ($start_rec < 0) {
$start_rec = 0;
}
$query .= $group_cond . " limit {$start_rec},{$list_max_entries_per_page}";
$result = $adb->pquery($query, $params);
$rows = $adb->num_rows($result);
$c = 0;
if ($start > 1) {
$c = ($start - 1) * $list_max_entries_per_page;
}
for ($i = 0; $i < $rows; $i++) {
$element = array();
$element['no'] = $c + 1;
$image_tag = "";
$contact_data = "";
$more_link = "";
$start_time = $adb->query_result($result, $i, "time_start");
$end_time = $adb->query_result($result, $i, "time_end");
$date_start = $adb->query_result($result, $i, "date_start");
$due_date = $adb->query_result($result, $i, "due_date");
$date = new DateTimeField($date_start . ' ' . $start_time);
//.........这里部分代码省略.........