本文整理汇总了PHP中Vtiger_Viewer::view方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Viewer::view方法的具体用法?PHP Vtiger_Viewer::view怎么用?PHP Vtiger_Viewer::view使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Viewer
的用法示例。
在下文中一共展示了Vtiger_Viewer::view方法的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: process
public function process($fieldName, $moduleName)
{
$viewer = new Vtiger_Viewer();
$viewer->assign('OPTION_LIST', $this->getOptions($fieldName));
$viewer->assign('FLD_ID', $fieldName);
$viewer->assign('FLD_NAME', $fieldName);
$viewer->assign('FLD_REQUIRED', $this->fieldIsRequired($fieldName, $moduleName));
return $viewer->view($this->tplAddress, "Settings:OSSProjectTemplates", true);
}
示例3: 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();
}
示例4: 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);
}
}
示例5: throwNewException
static function throwNewException($Message)
{
$request = new Vtiger_Request($_REQUEST);
if (!$request->get('action') != '') {
$viewer = new Vtiger_Viewer();
$viewer->assign('MESSAGE', $Message);
$viewer->view('OperationNotPermitted.tpl', 'Vtiger');
} else {
echo $Message;
}
}
示例6: 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');
}
示例7: runScheduledImport
public static function runScheduledImport()
{
global $current_user;
$scheduledImports = self::getScheduledImport();
$vtigerMailer = new Vtiger_Mailer();
$vtigerMailer->IsHTML(true);
foreach ($scheduledImports as $scheduledId => $importDataController) {
$current_user = $importDataController->user;
$importDataController->batchImport = false;
if (!$importDataController->initializeImport()) {
continue;
}
$importDataController->importData();
$importStatusCount = $importDataController->getImportStatusCount();
$emailSubject = 'vtiger CRM - Scheduled Import Report for ' . $importDataController->module;
$viewer = new Vtiger_Viewer();
$viewer->assign('FOR_MODULE', $importDataController->module);
$viewer->assign('INVENTORY_MODULES', getInventoryModules());
$viewer->assign('IMPORT_RESULT', $importStatusCount);
$importResult = $viewer->view('Import_Result_Details.tpl', 'Import', true);
$importResult = str_replace('align="center"', '', $importResult);
$emailData = 'vtiger CRM has just completed your import process. <br/><br/>' . $importResult . '<br/><br/>' . 'We recommend you to login to the CRM and check few records to confirm that the import has been successful.';
$userName = getFullNameFromArray('Users', $importDataController->user->column_fields);
$userEmail = $importDataController->user->email1;
$vtigerMailer->to = array(array($userEmail, $userName));
$vtigerMailer->Subject = $emailSubject;
$vtigerMailer->Body = $emailData;
$vtigerMailer->Send();
$importDataController->finishImport();
}
Vtiger_Mailer::dispatchQueue(null);
}
示例8: throwNewException
public static function throwNewException($message, $die = true, $tpl = 'OperationNotPermitted.tpl')
{
$request = new Vtiger_Request($_REQUEST);
if ($request->isAjax()) {
$response = new Vtiger_Response();
$response->setEmitType(Vtiger_Response::$EMIT_JSON);
$response->setError($message);
$response->emit();
} else {
$viewer = new Vtiger_Viewer();
$viewer->assign('MESSAGE', $message);
$viewer->view($tpl, 'Vtiger');
}
if ($die) {
exit;
}
}
示例9: undoLastImport
function undoLastImport($obj, $user)
{
$adb = PearDatabase::getInstance();
$moduleName = $obj->get('module');
$ownerId = $obj->get('foruser');
$owner = new Users();
$owner->id = $ownerId;
$owner->retrieve_entity_info($ownerId, 'Users');
$dbTableName = Import_Utils_Helper::getDbTableName($owner);
if (!is_admin($user) && $user->id != $owner->id) {
$viewer = new Vtiger_Viewer();
$viewer->view('OperationNotPermitted.tpl', 'Vtiger');
exit;
}
$result = $adb->query("SELECT recordid FROM {$dbTableName} WHERE temp_status = " . Import_Data_Controller::$IMPORT_RECORD_CREATED . " AND recordid IS NOT NULL;");
$noOfRecords = $adb->num_rows($result);
$noOfRecordsDeleted = 0;
for ($i = 0; $i < $noOfRecords; ++$i) {
$recordId = $adb->query_result($result, $i, 'recordid');
if (isRecordExists($recordId) && isPermitted($moduleName, 'Delete', $recordId) == 'yes') {
$focus = CRMEntity::getInstance($moduleName);
$focus->id = $recordId;
$focus->trash($moduleName, $recordId);
$noOfRecordsDeleted++;
}
}
$viewer = new Vtiger_Viewer();
$viewer->assign('FOR_MODULE', $moduleName);
$viewer->assign('TOTAL_RECORDS', $noOfRecords);
$viewer->assign('DELETED_RECORDS_COUNT', $noOfRecordsDeleted);
$viewer->view('ImportUndoResult.tpl');
}
示例10: throwNoPermittedException
public static function throwNoPermittedException($message, $die = true)
{
$request = new Vtiger_Request($_REQUEST);
$db = PearDatabase::getInstance();
$currentUser = Users_Record_Model::getCurrentUserModel();
$db->insert('s_yf_accesstorecord', ['username' => $currentUser->getDisplayName(), 'date' => date('Y-m-d H:i:s'), 'ip' => self::getRemoteIP(), 'record' => $request->get('record'), 'module' => $request->get('module'), 'url' => Vtiger_Functions::getBrowserInfo()->url, 'description' => '', 'agent' => $_SERVER['HTTP_USER_AGENT']]);
if ($request->isAjax()) {
$response = new Vtiger_Response();
$response->setEmitType(Vtiger_Response::$EMIT_JSON);
$response->setError($message);
$response->emit();
} else {
$viewer = new Vtiger_Viewer();
$viewer->assign('MESSAGE', $message);
$viewer->view('NoPermissionsForRecord.tpl', 'Vtiger');
}
if ($die) {
exit;
}
}
示例11: process
function process(Vtiger_Request $request)
{
Vtiger_Session::init();
// Better place this here as session get initiated
//skipping the csrf checking for the forgot(reset) password
if ($request->get('mode') != 'reset' && $request->get('action') != 'Login') {
require_once 'libraries/csrf-magic/csrf-magic.php';
}
// TODO - Get rid of global variable $current_user
// common utils api called, depend on this variable right now
$currentUser = $this->getLogin();
vglobal('current_user', $currentUser);
global $default_language;
vglobal('default_language', $default_language);
$currentLanguage = Vtiger_Language_Handler::getLanguage();
vglobal('current_language', $currentLanguage);
$module = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
if ($currentUser && $qualifiedModuleName) {
$moduleLanguageStrings = Vtiger_Language_Handler::getModuleStringsFromFile($currentLanguage, $qualifiedModuleName);
vglobal('mod_strings', $moduleLanguageStrings['languageStrings']);
}
if ($currentUser) {
$moduleLanguageStrings = Vtiger_Language_Handler::getModuleStringsFromFile($currentLanguage);
vglobal('app_strings', $moduleLanguageStrings['languageStrings']);
}
$view = $request->get('view');
$action = $request->get('action');
$response = false;
try {
if ($this->isInstalled() === false && $module != 'Install') {
header('Location:index.php?module=Install&view=Index');
exit;
}
if (empty($module)) {
if ($this->hasLogin()) {
$defaultModule = vglobal('default_module');
if (!empty($defaultModule) && $defaultModule != 'Home') {
$module = $defaultModule;
$qualifiedModuleName = $defaultModule;
$view = 'List';
if ($module == 'Calendar') {
// To load MyCalendar instead of list view for calendar
//TODO: see if it has to enhanced and get the default view from module model
$view = 'Calendar';
}
} else {
$module = 'Home';
$qualifiedModuleName = 'Home';
$view = 'DashBoard';
}
} else {
$module = 'Users';
$qualifiedModuleName = 'Settings:Users';
$view = 'Login';
}
$request->set('module', $module);
$request->set('view', $view);
}
if (!empty($action)) {
$componentType = 'Action';
$componentName = $action;
} else {
$componentType = 'View';
if (empty($view)) {
$view = 'Index';
}
$componentName = $view;
}
$handlerClass = Vtiger_Loader::getComponentClassName($componentType, $componentName, $qualifiedModuleName);
$handler = new $handlerClass();
if ($handler) {
vglobal('currentModule', $module);
// Ensure handler validates the request
$handler->validateRequest($request);
if ($handler->loginRequired()) {
$this->checkLogin($request);
}
//TODO : Need to review the design as there can potential security threat
$skipList = array('Users', 'Home', 'CustomView', 'Import', 'Export', 'Inventory', 'Vtiger', 'PriceBooks', 'Migration', 'Install');
if (!in_array($module, $skipList) && stripos($qualifiedModuleName, 'Settings') === false) {
$this->triggerCheckPermission($handler, $request);
}
// Every settings page handler should implement this method
if (stripos($qualifiedModuleName, 'Settings') === 0 || $module == 'Users') {
$handler->checkPermission($request);
}
$notPermittedModules = array('ModComments', 'Integration', 'DashBoard');
if (in_array($module, $notPermittedModules) && $view == 'List') {
header('Location:index.php?module=Home&view=DashBoard');
}
$this->triggerPreProcess($handler, $request);
$response = $handler->process($request);
$this->triggerPostProcess($handler, $request);
} else {
throw new AppException(vtranslate('LBL_HANDLER_NOT_FOUND'));
}
} catch (Exception $e) {
if ($view) {
// Log for developement.
//.........这里部分代码省略.........
示例12: deleteMap
public static function deleteMap($request)
{
$moduleName = $request->getModule();
$mapId = $request->get('mapid');
if (!empty($mapId)) {
Import_Map_Model::markAsDeleted($mapId);
}
$viewer = new Vtiger_Viewer();
$viewer->assign('FOR_MODULE', $moduleName);
$viewer->assign('MODULE', 'Import');
$viewer->assign('SAVED_MAPS', Import_Map_Model::getAllByModule($moduleName));
$viewer->view('Import_Saved_Maps.tpl', 'Import');
}
示例13: undoImport
function undoImport(Vtiger_Request $request)
{
$viewer = new Vtiger_Viewer();
$db = PearDatabase::getInstance();
$moduleName = $request->getModule();
$ownerId = $request->get('foruser');
$user = Users_Record_Model::getCurrentUserModel();
$dbTableName = Import_Utils_Helper::getDbTableName($user);
if (!$user->isAdminUser() && $user->id != $ownerId) {
$viewer->assign('MESSAGE', 'LBL_PERMISSION_DENIED');
$viewer->view('OperationNotPermitted.tpl', 'Vtiger');
exit;
}
$previousBulkSaveMode = $VTIGER_BULK_SAVE_MODE;
$VTIGER_BULK_SAVE_MODE = true;
$query = "SELECT recordid FROM {$dbTableName} WHERE temp_status = ? AND recordid IS NOT NULL";
//For inventory modules
$inventoryModules = getInventoryModules();
if (in_array($moduleName, $inventoryModules)) {
$query .= ' GROUP BY subject';
}
//End
$result = $db->pquery($query, array(Import_Data_Action::$IMPORT_RECORD_CREATED));
$noOfRecords = $db->num_rows($result);
$noOfRecordsDeleted = 0;
$entityData = array();
for ($i = 0; $i < $noOfRecords; $i++) {
$recordId = $db->query_result($result, $i, 'recordid');
if (isRecordExists($recordId) && isPermitted($moduleName, 'Delete', $recordId) == 'yes') {
$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
$recordModel->setId($recordId);
$recordModel->delete();
$focus = $recordModel->getEntity();
$focus->id = $recordId;
$entityData[] = VTEntityData::fromCRMEntity($focus);
$noOfRecordsDeleted++;
}
}
$entity = new VTEventsManager($db);
$entity->triggerEvent('vtiger.batchevent.delete', $entityData);
$VTIGER_BULK_SAVE_MODE = $previousBulkSaveMode;
$viewer->assign('FOR_MODULE', $moduleName);
$viewer->assign('MODULE', 'Import');
$viewer->assign('TOTAL_RECORDS', $noOfRecords);
$viewer->assign('DELETED_RECORDS_COUNT', $noOfRecordsDeleted);
$viewer->view('ImportUndoResult.tpl', 'Import');
}
示例14: throwNewException
static function throwNewException($message)
{
$request = new Vtiger_Request($_REQUEST);
if ($request->isAjax()) {
$response = new Vtiger_Response();
$response->setEmitType(Vtiger_Response::$EMIT_JSON);
$response->setError($message);
$response->emit();
} else {
$viewer = new Vtiger_Viewer();
$viewer->assign('MESSAGE', $message);
$text = $viewer->view('OperationNotPermitted.tpl', 'Vtiger', true);
die($text);
}
}
示例15: process
public function process(Vtiger_Request $request)
{
$theme = vglobal('theme');
$list_max_entries_per_page = vglobal('list_max_entries_per_page');
$db = PearDatabase::getInstance();
$smarty = new Vtiger_Viewer();
//include_once( 'modules/OSSPdf/constraints_methods.php' );
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$idstring = $request->get('record');
$module_name = $request->get('source_module');
$pobierz_id = $db->query("select tabid from vtiger_tab where name = '{$module_name}'", true);
$tabid = $db->query_result($pobierz_id, 0, "tabid");
$pobierz_rekordy = $db->query("select * from vtiger_osspdf inner join vtiger_crmentity on (vtiger_crmentity.crmid = vtiger_osspdf.osspdfid ) where moduleid = '{$tabid}' and deleted <> '1'", true);
$permitted_templates = array();
$indeks = 0;
for ($i = 0; $i < $db->num_rows($pobierz_rekordy); $i++) {
$rekord = $db->query_result($pobierz_rekordy, $i, "osspdfid");
$name = $db->query_result($pobierz_rekordy, $i, "title");
$selected = $db->query_result($pobierz_rekordy, $i, "selected");
$osspdf_view = $db->query_result($pobierz_rekordy, $i, "osspdf_view");
if ($request->get('fromdetailview')) {
///Conditions
vimport('~~modules/OSSPdf/helpers/Conditions.php');
$Condition = Conditions::checkConditionsForRecord($rekord, $idstring, $request);
//echo '<pre>';var_dump($osspdf_view);echo '</pre>';
///Conditions
if (isPermitted("OSSPdf", "DetailView", $rekord) == 'yes') {
if ($Condition['test'] && (!(strpos($osspdf_view, 'Detail') === false) || !(strpos($osspdf_view, vtranslate('Detail', 'OSSPdf')) === false))) {
$permitted_templates[$indeks]['id'] = $rekord;
$permitted_templates[$indeks]['name'] = $name;
$permitted_templates[$indeks]['checked'] = $selected;
$indeks++;
}
}
}
}
if ($indeks == 0) {
$smarty->assign("NO_TEMPLATES", "yes");
} else {
$smarty->assign("NO_TEMPLATES", "no");
}
if ($request->get('fromdetailview') != '') {
$smarty->assign("FROM_DETAILVIEW", "yes");
} else {
$smarty->assign("FROM_DETAILVIEW", "no");
}
$TABLE = array('4A0' => '4A0', '2A0' => '2A0', 'A0' => 'A0', 'A1' => 'A1', 'A2' => 'A2', 'A3' => 'A3', 'A4' => 'A4', 'A5' => 'A5', 'A6' => 'A6', 'A7' => 'A7', 'A8' => 'A8', 'A9' => 'A9', 'A10' => 'A10', 'B0' => 'B0', 'B1' => 'B1', 'B2' => 'B2', 'B3' => 'B3', 'B4' => 'B4', 'B5' => 'B5', 'B6' => 'B6', 'B7' => 'B7', 'B8' => 'B8', 'B9' => 'B9', 'B10' => 'B10', 'C0' => 'C0', 'C1' => 'C1', 'C2' => 'C2', 'C3' => 'C3', 'C4' => 'C4', 'C5' => 'C5', 'C6' => 'C6', 'C7' => 'C7', 'C8' => 'C8', 'C9' => 'C9', 'C10' => 'C10', 'RA0' => 'RA0', 'RA1' => 'RA1', 'RA2' => 'RA2', 'RA3' => 'RA3', 'RA4' => 'RA4', 'SRA0' => 'SRA0', 'SRA1' => 'SRA1', 'SRA2' => 'SRA2', 'SRA3' => 'SRA3', 'SRA4' => 'SRA4', 'LETTER' => 'LETTER', 'LEGAL' => 'LEGAL', 'EXECUTIVE' => 'EXECUTIVE', 'FOLIO' => 'FOLIO');
if ($request->get('usingmodule') == 'Reports') {
$smarty->assign('advft_criteria', htmlspecialchars($request->get('advft_criteria')));
$smarty->assign('advft_criteria_groups', htmlspecialchars($request->get('advft_criteria_groups')));
}
$smarty->assign('Formats', $TABLE);
$smarty->assign("SESSION_WHERE", $_SESSION['export_where']);
$smarty->assign("templates", $permitted_templates);
$smarty->assign('APP', $app_strings);
$smarty->assign('MOD', $mod_strings);
$smarty->assign("THEME", $theme_path);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("RECORD", $idstring);
$smarty->assign("MODULE", $module_name);
$smarty->assign("USINGMODULE", $module_name);
$smarty->assign("MODULELABEL", getTranslatedString($module_name));
$smarty->assign("IDSTRING", $idstring);
$smarty->assign("PERPAGE", $list_max_entries_per_page);
$smarty->assign("OSS_MILE_EXISTS", OSSPdf_Module_Model::moduleIsActive('OSSMail'));
$smarty->view('ExportRecords.tpl', 'OSSPdf');
}