本文整理汇总了PHP中ListViewSession::getListViewNavigation方法的典型用法代码示例。如果您正苦于以下问题:PHP ListViewSession::getListViewNavigation方法的具体用法?PHP ListViewSession::getListViewNavigation怎么用?PHP ListViewSession::getListViewNavigation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListViewSession
的用法示例。
在下文中一共展示了ListViewSession::getListViewNavigation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process(Vtiger_Request $request)
{
$recordId = $request->get('record');
$qualifiedModuleName = $request->getModule(false);
$recordModel = Settings_Webforms_Record_Model::getInstanceById($recordId, $qualifiedModuleName);
$recordModel->set('posturl', vglobal('site_URL') . 'modules/Webforms/capture.php');
$recordStructure = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_DETAIL);
$moduleModel = $recordModel->getModule();
$navigationInfo = ListViewSession::getListViewNavigation($recordId);
$viewer = $this->getViewer($request);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('MODULE_NAME', $qualifiedModuleName);
$viewer->assign('RECORD_STRUCTURE', $recordStructure->getStructure());
$viewer->assign('MODULE_MODEL', $moduleModel);
$viewer->assign('BLOCK_LIST', $moduleModel->getBlocks());
$viewer->assign('SOURCE_MODULE', $recordModel->get('targetmodule'));
$viewer->assign('DETAILVIEW_LINKS', $recordModel->getDetailViewLinks());
$viewer->assign('SELECTED_FIELD_MODELS_LIST', $recordModel->getSelectedFieldsList());
$viewer->assign('NO_PAGINATION', true);
$viewer->view('DetailView.tpl', $qualifiedModuleName);
}
示例2: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request, false);
$recordId = $request->get('record');
$moduleName = $request->getModule();
if (!$this->record) {
$this->record = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
}
$recordModel = $this->record->getRecord();
$recordStrucure = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_DETAIL);
$summaryInfo = array();
// Take first block information as summary information
$stucturedValues = $recordStrucure->getStructure();
foreach ($stucturedValues as $blockLabel => $fieldList) {
$summaryInfo[$blockLabel] = $fieldList;
break;
}
$detailViewLinkParams = array('MODULE' => $moduleName, 'RECORD' => $recordId);
$detailViewLinks = $this->record->getDetailViewLinks($detailViewLinkParams);
$this->record->getWidgets($detailViewLinkParams);
$navigationInfo = ListViewSession::getListViewNavigation($recordId);
$viewer = $this->getViewer($request);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('NAVIGATION', $navigationInfo);
$viewer->assign('COLORLISTHANDLERS', Settings_DataAccess_Module_Model::executeColorListHandlers($moduleName, $recordId, false));
//Intially make the prev and next records as null
$prevRecordId = null;
$nextRecordId = null;
$found = false;
if ($navigationInfo) {
foreach ($navigationInfo as $page => $pageInfo) {
foreach ($pageInfo as $index => $record) {
//If record found then next record in the interation
//will be next record
if ($found) {
$nextRecordId = $record;
break;
}
if ($record == $recordId) {
$found = true;
}
//If record not found then we are assiging previousRecordId
//assuming next record will get matched
if (!$found) {
$prevRecordId = $record;
}
}
//if record is found and next record is not calculated we need to perform iteration
if ($found && !empty($nextRecordId)) {
break;
}
}
}
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
if (!empty($prevRecordId)) {
$viewer->assign('PREVIOUS_RECORD_URL', $moduleModel->getDetailViewUrl($prevRecordId));
}
if (!empty($nextRecordId)) {
$viewer->assign('NEXT_RECORD_URL', $moduleModel->getDetailViewUrl($nextRecordId));
}
$viewer->assign('MODULE_MODEL', $this->record->getModule());
$viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
$viewer->assign('DETAILVIEW_WIDGETS', $this->record->widgets);
$viewer->assign('IS_EDITABLE', $this->record->getRecord()->isEditable($moduleName));
$viewer->assign('IS_DELETABLE', $this->record->getRecord()->isDeletable($moduleName));
$linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
$linkModels = $this->record->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $linkModels);
$viewer->assign('MODULE_NAME', $moduleName);
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$viewer->assign('DEFAULT_RECORD_VIEW', $currentUserModel->get('default_record_view'));
$picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
$viewer->assign('PICKLIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
if ($display) {
$this->preProcessDisplay($request);
}
}
示例3: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request, false);
$recordId = $request->get('record');
$moduleName = $request->getModule();
if (!empty($recordId)) {
$recordModel = Vtiger_Record_Model::getInstanceById($recordId);
$activityType = $recordModel->getType();
if ($activityType == 'Events') {
$moduleName = 'Events';
}
}
$detailViewModel = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
$recordModel = $detailViewModel->getRecord();
$recordStrucure = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_DETAIL);
$summaryInfo = array();
// Take first block information as summary information
$stucturedValues = $recordStrucure->getStructure();
foreach ($stucturedValues as $blockLabel => $fieldList) {
$summaryInfo[$blockLabel] = $fieldList;
break;
}
$detailViewLinkParams = array('MODULE' => $moduleName, 'RECORD' => $recordId);
$detailViewLinks = $detailViewModel->getDetailViewLinks($detailViewLinkParams);
$navigationInfo = ListViewSession::getListViewNavigation($recordId);
$viewer = $this->getViewer($request);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('NAVIGATION', $navigationInfo);
//Intially make the prev and next records as null
$prevRecordId = null;
$nextRecordId = null;
$found = false;
if ($navigationInfo) {
foreach ($navigationInfo as $page => $pageInfo) {
foreach ($pageInfo as $index => $record) {
//If record found then next record in the interation
//will be next record
if ($found) {
$nextRecordId = $record;
break;
}
if ($record == $recordId) {
$found = true;
}
//If record not found then we are assiging previousRecordId
//assuming next record will get matched
if (!$found) {
$prevRecordId = $record;
}
}
//if record is found and next record is not calculated we need to perform iteration
if ($found && !empty($nextRecordId)) {
break;
}
}
}
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
if (!empty($prevRecordId)) {
$viewer->assign('PREVIOUS_RECORD_URL', $moduleModel->getDetailViewUrl($prevRecordId));
}
if (!empty($nextRecordId)) {
$viewer->assign('NEXT_RECORD_URL', $moduleModel->getDetailViewUrl($nextRecordId));
}
$viewer->assign('MODULE_MODEL', $detailViewModel->getModule());
$viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
$viewer->assign('IS_EDITABLE', $detailViewModel->getRecord()->isEditable($moduleName));
$viewer->assign('IS_DELETABLE', $detailViewModel->getRecord()->isDeletable($moduleName));
$linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
$linkModels = $detailViewModel->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $linkModels);
$viewer->assign('NO_SUMMARY', true);
if ($display) {
$this->preProcessDisplay($request);
}
}
示例4: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
$db = PearDatabase::getInstance();
parent::preProcess($request, false);
$origModuleName = $request->getModule();
$recordId = $request->get('record');
if (!$this->record) {
$this->record = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
}
$recordModel = $this->record->getRecord();
$recordStrucure = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_DETAIL);
$summaryInfo = array();
// Take first block information as summary information
$stucturedValues = $recordStrucure->getStructure();
foreach ($stucturedValues as $blockLabel => $fieldList) {
$summaryInfo[$blockLabel] = $fieldList;
break;
}
$detailViewLinkParams = array('MODULE' => $moduleName, 'RECORD' => $recordId);
$detailViewLinks = $this->record->getDetailViewLinks($detailViewLinkParams);
$navigationInfo = ListViewSession::getListViewNavigation($recordId);
$viewer = $this->getViewer($request);
$modid = $recordModel->get('moduleid');
$moduleNameResult = $db->query("select name from vtiger_tab where tabid = '{$modid}'", true);
$moduleName = $db->query_result($moduleNameResult, 0, 'name');
$tName = vtranslate($moduleName, $moduleName);
$viewer->assign('MODULEID_NAME', $tName);
$viewer->assign('RECORD', $recordModel);
//var_dump($recordModel);
//exit;
///Conditions
vimport('~~modules/OSSPdf/helpers/Conditions.php');
$baseModule = Vtiger_Functions::getModuleName($modid);
$Condition = Conditions::getConditionRelToRecordFieldInfo($request->get('record'), $baseModule);
$viewer->assign('REQUIRED_CONDITIONS', $Condition['required_conditions']);
$viewer->assign('OPTIONAL_CONDITIONS', $Condition['optional_conditions']);
$viewer->assign('BASE_MODULE', $baseModule);
///Conditions
$viewer->assign('NAVIGATION', $navigationInfo);
//Intially make the prev and next records as null
$prevRecordId = null;
$nextRecordId = null;
$found = false;
if ($navigationInfo) {
foreach ($navigationInfo as $page => $pageInfo) {
foreach ($pageInfo as $index => $record) {
//If record found then next record in the interation
//will be next record
if ($found) {
$nextRecordId = $record;
break;
}
if ($record == $recordId) {
$found = true;
}
//If record not found then we are assiging previousRecordId
//assuming next record will get matched
if (!$found) {
$prevRecordId = $record;
}
}
//if record is found and next record is not calculated we need to perform iteration
if ($found && !empty($nextRecordId)) {
break;
}
}
}
$moduleModel = Vtiger_Module_Model::getInstance($origModuleName);
if (!empty($prevRecordId)) {
$viewer->assign('PREVIOUS_RECORD_URL', $moduleModel->getDetailViewUrl($prevRecordId));
}
if (!empty($nextRecordId)) {
$viewer->assign('NEXT_RECORD_URL', $moduleModel->getDetailViewUrl($nextRecordId));
}
$viewer->assign('MODULE_MODEL', $this->record->getModule());
$viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
$viewer->assign('MODULE', $request->getModule());
$viewer->assign('IS_EDITABLE', $this->record->getRecord()->isEditable($moduleName));
$viewer->assign('IS_DELETABLE', $this->record->getRecord()->isDeletable($moduleName));
$viewer->assign('URL_CONTENT', "index.php?module=OSSPdf&view=content&record={$recordId}");
$viewer->assign('URL_FOOTER', "index.php?module=OSSPdf&view=footer&record={$recordId}");
$viewer->assign('URL_HEADER', "index.php?module=OSSPdf&view=header&record={$recordId}");
$linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
$linkModels = $this->record->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $linkModels);
if ($display) {
$this->preProcessDisplay($request);
}
}
示例5: CheckFieldPermission
$smarty->assign("TODO_PERMISSION", CheckFieldPermission('parent_id', 'Calendar'));
$smarty->assign("EVENT_PERMISSION", CheckFieldPermission('parent_id', 'Events'));
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$smarty->assign("EDIT_PERMISSION", isPermitted($currentModule, 'EditView', $_REQUEST['record']));
$smarty->assign("IS_REL_LIST", isPresentRelatedLists($currentModule));
if ($singlepane_view == 'true') {
$related_array = getRelatedLists($currentModule, $focus);
$smarty->assign("RELATEDLISTS", $related_array);
require_once 'include/ListView/RelatedListViewSession.php';
if (!empty($_REQUEST['selected_header']) && !empty($_REQUEST['relation_id'])) {
RelatedListViewSession::addRelatedModuleToSession(vtlib_purify($_REQUEST['relation_id']), vtlib_purify($_REQUEST['selected_header']));
}
$open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
$smarty->assign("SELECTEDHEADERS", $open_related_modules);
}
$smarty->assign("SinglePane_View", $singlepane_view);
if (PerformancePrefs::getBoolean('DETAILVIEW_RECORD_NAVIGATION', true) && isset($_SESSION[$currentModule . '_listquery'])) {
$recordNavigationInfo = ListViewSession::getListViewNavigation($focus->id);
VT_detailViewNavigation($smarty, $recordNavigationInfo, $focus->id);
}
// Record Change Notification
$focus->markAsViewed($current_user->id);
// END
// Gather the custom link information to display
include_once 'vtlib/Vtiger/Link.php';
$customlink_params = array('MODULE' => $currentModule, 'RECORD' => $focus->id, 'ACTION' => vtlib_purify($_REQUEST['action']));
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), array('DETAILVIEWBASIC', 'DETAILVIEW', 'DETAILVIEWWIDGET'), $customlink_params));
// END
$smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
$smarty->display("Inventory/InventoryDetailView.tpl");