本文整理汇总了PHP中Vtiger_Viewer类的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Viewer类的具体用法?PHP Vtiger_Viewer怎么用?PHP Vtiger_Viewer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vtiger_Viewer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process($fieldName, $moduleName)
{
$viewer = new Vtiger_Viewer();
$viewer->assign('FLD_NAME', $fieldName);
$viewer->assign('FLD_ID', $fieldName);
return $viewer->view($this->tplAddress, "Settings:OSSProjectTemplates", true);
}
示例2: initializeListViewContents
public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
{
$moduleName = $this->getModule($request);
$sourceModule = $request->get('src_module');
$sourceRecord = $request->get('src_record');
//list of records is narrowed to contacts related to help desks account, only in Help Desk Contacts relation view
if ($moduleName == 'Contacts' && $sourceModule == 'HelpDesk' && isRecordExists($sourceRecord) && strpos($_SERVER['QUERY_STRING'], 'module=Contacts&src_module=HelpDesk') === 0) {
$request->set('related_parent_module', 'Accounts');
$helpDeskRecord = Vtiger_Record_Model::getInstanceById($sourceRecord, 'HelpDesk');
$request->set('related_parent_id', $helpDeskRecord->get('parent_id'));
$viewer->assign('SWITCH', true);
}
if ($moduleName == 'Contacts' && $sourceModule == 'SSalesProcesses' && isRecordExists($sourceRecord) && strpos($_SERVER['QUERY_STRING'], 'module=Contacts&src_module=SSalesProcesses') === 0) {
$request->set('related_parent_module', 'Accounts');
$moduleRecord = Vtiger_Record_Model::getInstanceById($sourceRecord, 'SSalesProcesses');
$request->set('related_parent_id', $moduleRecord->get('related_to'));
$viewer->assign('SWITCH', true);
}
if ($moduleName == 'Contacts' && $sourceModule == 'Project' && isRecordExists($sourceRecord) && strpos($_SERVER['QUERY_STRING'], 'module=Contacts&src_module=Project') === 0) {
$request->set('related_parent_module', 'Accounts');
$moduleRecord = Vtiger_Record_Model::getInstanceById($sourceRecord, 'Project');
$request->set('related_parent_id', $moduleRecord->get('linktoaccountscontacts'));
$viewer->assign('SWITCH', true);
}
parent::initializeListViewContents($request, $viewer);
}
示例3: ShowModuleIdField
function ShowModuleIdField($selected_module, $tab_only = false)
{
$db = PearDatabase::getInstance();
$names = array('Emails', 'PBXManager', 'ModComments', 'SMSNotifier', 'OSSPdf');
foreach ($names as $id) {
$in .= "'" . $id . "',";
}
$in = trim($in, ',');
$query = "select tabid, name, customized from vtiger_tab where isentitytype = '1' and presence <> '2' and name not in ( {$in} )";
$wynik = $db->query($query, true);
$tablist = array();
for ($i = 0; $i < $db->num_rows($wynik); $i++) {
$tablist[$i]['id'] = $db->query_result($wynik, $i, "tabid");
$label = $db->query_result($wynik, $i, "name");
if ($db->query_result($wynik, $i, "customized") == 0) {
$tablist[$i]['label'] = getTranslatedString($label);
} else {
$tablist[$i]['label'] = getTranslatedString($label, $label);
}
}
if ($selected_module == '') {
$SMODULE = $tablist[0]['id'];
} else {
$SMODULE = $selected_module;
}
if ($tab_only == false) {
$viewer = new Vtiger_Viewer();
$viewer->assign("TABLIST", $tablist);
$viewer->assign("SMODULE", $SMODULE);
$viewer->assign("SELECTED_MODULE", $selected_module);
return $viewer->fetch('modules/OSSPdf/FieldModuleid.tpl');
} else {
return $tablist;
}
}
示例4: showErrorPage
public static function showErrorPage($errorMessage, $errorDetails = false, $customActions = false)
{
$viewer = new Vtiger_Viewer();
$viewer->assign('ERROR_MESSAGE', $errorMessage);
$viewer->assign('ERROR_DETAILS', $errorDetails);
$viewer->assign('CUSTOM_ACTIONS', $customActions);
$viewer->assign('MODULE', 'Import');
$viewer->view('ImportError.tpl', 'Import');
}
示例5: viewController
function viewController()
{
$smarty = new Vtiger_Viewer();
foreach ($this->parameters as $k => $v) {
$smarty->assign($k, $v);
}
$smarty->assign("IS_SAFARI", Mobile::isSafari());
$smarty->assign("SKIN", Mobile::config('Default.Skin'));
return $smarty;
}
示例6: 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 = "icon-chevron-down";
} else {
$nextSortOrder = "ASC";
$sortImage = "icon-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);
$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', $listViewModel->calculatePageRange($listviewEntries, $pagingModel));
}
示例7: changePassword
public function changePassword($data)
{
global $site_URL;
$request = new Vtiger_Request($data);
$userName = $request->get('username');
$viewer = Vtiger_Viewer::getInstance();
$companyModel = Vtiger_CompanyDetails_Model::getInstanceById();
$companyName = $companyModel->get('organizationname');
$organisationDetails = $companyModel->getLogo();
$logoTitle = $organisationDetails->get('title');
$logoName = $organisationDetails->get('imagename');
$moduleName = 'Users';
$viewer->assign('LOGOURL', $site_URL . '/test/logo/' . $logoName);
$viewer->assign('TITLE', $logoTitle);
$viewer->assign('COMPANYNAME', $companyName);
$viewer->assign('USERNAME', $userName);
$changePasswordTrackUrl = $site_URL . "/modules/Users/actions/ForgotPassword.php";
$viewer->assign('TRACKURL', $changePasswordTrackUrl);
$expiryTime = (int) $request->get('time') + 24 * 60 * 60;
$currentTime = time();
if ($expiryTime > $currentTime) {
$secretToken = uniqid();
$secretHash = md5($userName . $secretToken);
$options = array('handler_path' => 'modules/Users/handlers/ForgotPassword.php', 'handler_class' => 'Users_ForgotPassword_Handler', 'handler_function' => 'changePassword', 'onetime' => 1, 'handler_data' => array('username' => $userName, 'secret_token' => $secretToken, 'secret_hash' => $secretHash));
$trackURL = Vtiger_ShortURL_Helper::generateURL($options);
$shortURLID = explode('id=', $trackURL);
$viewer->assign('SHORTURL_ID', $shortURLID[1]);
$viewer->assign('SECRET_HASH', $secretHash);
} else {
$viewer->assign('LINK_EXPIRED', true);
}
$viewer->assign('TRACKURL', $changePasswordTrackUrl);
$viewer->assign('MODULE', $moduleName);
$viewer->view('ForgotPassword.tpl', $moduleName);
}
示例8: changePassword
public function changePassword($request)
{
$request = new Vtiger_Request($request);
$viewer = Vtiger_Viewer::getInstance();
$userName = $request->get('username');
$newPassword = $request->get('password');
$confirmPassword = $request->get('confirmPassword');
$shortURLID = $request->get('shorturl_id');
$secretHash = $request->get('secret_hash');
$shortURLModel = Vtiger_ShortURL_Helper::getInstance($shortURLID);
$secretToken = $shortURLModel->handler_data['secret_token'];
$validateData = array('username' => $userName, 'secret_token' => $secretToken, 'secret_hash' => $secretHash);
$valid = $shortURLModel->compareEquals($validateData);
if ($valid) {
$userId = getUserId_Ol($userName);
$user = Users::getActiveAdminUser();
$wsUserId = vtws_getWebserviceEntityId('Users', $userId);
vtws_changePassword($wsUserId, '', $newPassword, $confirmPassword, $user);
} else {
$viewer->assign('ERROR', true);
}
$shortURLModel->delete();
$viewer->assign('USERNAME', $userName);
$viewer->assign('PASSWORD', $newPassword);
$viewer->view('FPLogin.tpl', 'Users');
}
示例9: initializeListViewContents
public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
{
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$listViewModel = Settings_Vtiger_ListView_Model::getInstance($qualifiedModuleName);
$listViewModel->set('orderby', 'sequence');
$pagingModel = new Vtiger_Paging_Model();
if (!$this->listViewHeaders) {
$this->listViewHeaders = $listViewModel->getListViewHeaders();
}
if (!$this->listViewEntries) {
$this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
}
$viewer->assign('MODULE_MODEL', $listViewModel->getModule());
$viewer->assign('PAGING_MODEL', $pagingModel);
$viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
$viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
}
示例10: initializeListViewContents
public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
{
$moduleName = $request->getModule();
$sourceModule = $request->get('sourceModule');
$pageNumber = $request->get('page');
$orderBy = $request->get('orderby');
$sortOrder = $request->get('sortorder');
if ($sortOrder == "ASC") {
$nextSortOrder = "DESC";
$sortImage = "icon-chevron-down";
} else {
$nextSortOrder = "ASC";
$sortImage = "icon-chevron-up";
}
if (empty($pageNumber)) {
$pageNumber = '1';
}
$listViewModel = RecycleBin_ListView_Model::getInstance($moduleName, $sourceModule);
$moduleModel = RecycleBin_Module_Model::getInstance($moduleName);
$linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
$linkModels = $moduleModel->getListViewMassActions($linkParams);
$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('LISTVIEW_LINKS', $moduleModel->getListViewLinks());
$viewer->assign('LISTVIEW_MASSACTIONS', $linkModels);
$viewer->assign('PAGING_MODEL', $pagingModel);
$viewer->assign('PAGE_NUMBER', $pageNumber);
$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_ENTIRES_COUNT', $noOfEntries);
$viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
$viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
$viewer->assign('MODULE_LIST', $moduleModel->getAllModuleList());
$viewer->assign('SOURCE_MODULE', $sourceModule);
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false)) {
if (!$this->listViewCount) {
$this->listViewCount = $listViewModel->getListViewCount();
}
$viewer->assign('LISTVIEW_COUNT', $this->listViewCount);
}
$viewer->assign('IS_MODULE_DELETABLE', $listViewModel->getModule()->isPermitted('Delete'));
}
示例11: process
public function process($fieldName, $moduleName, $editView)
{
$viewer = new Vtiger_Viewer();
$viewer->assign('OPTION_LIST', $this->getOptions($fieldName));
$viewer->assign('FLD_ID', $fieldName);
$viewer->assign('EDIT_VIEW', $editView);
$viewer->assign('FLD_NAME', $fieldName);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('FLD_REQUIRED', $this->fieldIsRequired($fieldName, $moduleName));
return $viewer->view($this->tplAddress, "Settings:OSSProjectTemplates", true);
}
示例12: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$widgetView = new Reports_ChartDetail_View();
$currentUser = Users_Record_Model::getCurrentUserModel();
$widget = Vtiger_Widget_Model::getInstance($request->get('linkid'), $currentUser->getId());
$widget->applyTemplateRecordId($request->get('report_record_id'));
$viewer = new Vtiger_Viewer();
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$content = $request->get('content');
$reportDisplay = $widgetView->getReport($request, true);
if (!empty($content)) {
echo $reportDisplay;
} else {
$viewer->assign('CHART_REPORT_WIDGET_CONTENTS', $reportDisplay);
$viewer->view('dashboards/ChartReportWidget.tpl', $moduleName);
}
}
示例13: getLayoutFile
public static function getLayoutFile($name)
{
$basePath = 'layouts' . '/' . vglobal('defaultLayout') . '/';
$filePath = Vtiger_Loader::resolveNameToPath('~' . $basePath . $name);
if (is_file($filePath)) {
return $basePath . $name;
}
$basePath = 'layouts' . '/' . Vtiger_Viewer::getDefaultLayoutName() . '/';
return $basePath . $name;
}
示例14: checkLimits
public function checkLimits(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$record = $request->get('record');
$currency = $request->get('currency');
$price = $request->get('price');
$limitConfig = $request->get('limitConfig');
$limitFieldName = 'creditlimit';
$balanceFieldName = 'inventorybalance';
$moduleInstance = Vtiger_Module_Model::getInstance('Accounts');
$limitField = Vtiger_Field_Model::getInstance($limitFieldName, $moduleInstance);
$balanceField = Vtiger_Field_Model::getInstance($balanceFieldName, $moduleInstance);
if (!$limitField->isActiveField() || !$balanceField->isActiveField()) {
$response = new Vtiger_Response();
$response->setResult(['status' => true]);
$response->emit();
return;
}
$recordModel = Vtiger_Record_Model::getInstanceById($record, 'Accounts');
$limitID = $recordModel->get($limitFieldName);
$balance = $recordModel->get($balanceFieldName);
$limit = reset(Vtiger_InventoryLimit_UIType::getValues($limitID))['value'];
$baseCurrency = Vtiger_Util_Helper::getBaseCurrency();
$symbol = $baseCurrency['currency_symbol'];
if ($baseCurrency['id'] != $currency) {
$selectedCurrency = Vtiger_Functions::getCurrencySymbolandRate($currency);
$price = floatval($price) * $selectedCurrency['rate'];
$symbol = $selectedCurrency['symbol'];
}
$totalPrice = $price + $balance;
$status = $totalPrice > $limit ? false : true;
if (!$status) {
$viewer = new Vtiger_Viewer();
$viewer->assign('PRICE', $price);
$viewer->assign('BALANCE', $balance);
$viewer->assign('SYMBOL', $symbol);
$viewer->assign('LIMIT', $limit);
$viewer->assign('TOTALS', $totalPrice);
$viewer->assign('LIMIT_CONFIG', $limitConfig);
$html = $viewer->view('InventoryLimitAlert.tpl', $moduleName, true);
}
$response = new Vtiger_Response();
$response->setResult([
'status' => $status,
'html' => $html
]);
$response->emit();
}
示例15: initializeListViewContents
public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer)
{
$moduleName = $this->getModule($request);
$recordId = $request->get('record');
$tooltipViewModel = Vtiger_TooltipView_Model::getInstance($moduleName, $recordId);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('MODULE_MODEL', $tooltipViewModel->getRecord()->getModule());
$viewer->assign('TOOLTIP_FIELDS', $tooltipViewModel->getFields());
$viewer->assign('RECORD', $tooltipViewModel->getRecord());
$viewer->assign('RECORD_STRUCTURE', $tooltipViewModel->getStructure());
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
}