当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_Functions类代码示例

本文整理汇总了PHP中Vtiger_Functions的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Functions类的具体用法?PHP Vtiger_Functions怎么用?PHP Vtiger_Functions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Vtiger_Functions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showTaxes

 function showTaxes(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $record = $request->get('record');
     $recordModule = $request->get('recordModule');
     $currency = $request->get('currency');
     $sourceRecord = $request->get('sourceRecord');
     $taxType = $request->get('taxType');
     $totalPrice = $request->get('totalPrice');
     $inventoryModel = Vtiger_Inventory_Model::getInstance($moduleName);
     $accountTaxs = $inventoryModel->getAccountTax($moduleName, $sourceRecord);
     $config = $inventoryModel->getTaxesConfig();
     $viewer = $this->getViewer($request);
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('RECORD', $record);
     $viewer->assign('RECORD_MODULE', $recordModule);
     $viewer->assign('GLOBAL_TAXS', $inventoryModel->getGlobalTaxs());
     $viewer->assign('CURRENCY_SYMBOL', Vtiger_Functions::getCurrencySymbolandRate($currency)['symbol']);
     $viewer->assign('TOTAL_PRICE', $totalPrice);
     $viewer->assign('CONFIG', $config);
     $viewer->assign('TAX_TYPE', $taxType);
     $viewer->assign('TAX_FIELD', Vtiger_InventoryField_Model::getTaxField($recordModule));
     $viewer->assign('AGGREGATION_TYPE', $config['aggregation']);
     $viewer->assign('AGGREGATION_INPUT_TYPE', $config['aggregation'] == 0 ? 'radio' : 'checkbox');
     $viewer->assign('GROUP_TAXS', $accountTaxs['taxs']);
     $viewer->assign('ACCOUNT_NAME', $accountTaxs['name']);
     echo $viewer->view('InventoryTaxes.tpl', $moduleName, true);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:28,代码来源:Inventory.php

示例2: getListFiledOfRelatedModule

 function getListFiledOfRelatedModule($moduleName)
 {
     $db = PearDatabase::getInstance();
     $tabid = getTabid($moduleName);
     $sourceModule = $moduleName;
     $sql = "select vtiger_field.fieldid, fieldlabel, uitype, vtiger_fieldmodulerel.relmodule from vtiger_field \n\t\t\t\tleft JOIN vtiger_fieldmodulerel ON vtiger_fieldmodulerel.fieldid = vtiger_field.fieldid where tabid = ? AND (uitype = '10' OR uitype = '59' OR uitype = '53' OR uitype = '51')";
     $resultModuleList = $db->pquery($sql, array($tabid), true);
     $moduleList = array();
     for ($i = 0; $i < $db->num_rows($resultModuleList); $i++) {
         $uitype = $db->query_result($resultModuleList, $i, 'uitype');
         $fieldid = $db->query_result($resultModuleList, $i, 'fieldid');
         $fieldlabel = $db->query_result($resultModuleList, $i, 'fieldlabel');
         if ($uitype == 10) {
             $moduleList[] = array(Vtiger_Functions::getModuleId($db->query_result($resultModuleList, $i, 'relmodule')), $fieldlabel, $fieldid);
         } elseif ($uitype == 51) {
             $moduleList[] = array(Vtiger_Functions::getModuleId('Accounts'), $fieldlabel, $fieldid);
         } elseif ($uitype == 59) {
             $moduleList[] = array(Vtiger_Functions::getModuleId('Products'), $fieldlabel, $fieldid);
         } elseif ($uitype == 53) {
             $moduleList[] = array(Vtiger_Functions::getModuleId('Users'), $fieldlabel, $fieldid);
         }
     }
     $output = array();
     for ($i = 0; $i < count($moduleList); $i++) {
         $moduleInfoSql = "SELECT * FROM vtiger_tab WHERE tabid = ?";
         $moduleInfoResult = $db->pquery($moduleInfoSql, array($moduleList[$i][0]), true);
         $moduleName = $db->query_result($moduleInfoResult, 0, 'name');
         $moduleTrLabal = vtranslate($moduleList[$i][1], $sourceModule);
         $output[$moduleTrLabal] = array();
         $output[$moduleTrLabal] = $this->getListFiledOfModule($moduleName, $moduleList[$i][2]);
     }
     return $output;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:33,代码来源:Module.php

示例3: getSelectableDashboard

 public function getSelectableDashboard()
 {
     global $log;
     $log->debug("Entering Settings_WidgetsManagement_Module_Model::getSelectableDashboard() method ...");
     $db = PearDatabase::getInstance();
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $sql = 'SELECT * FROM vtiger_links WHERE linktype = ?';
     $params = array('DASHBOARDWIDGET');
     $result = $db->pquery($sql, $params);
     $widgets = array();
     for ($i = 0; $i < $db->num_rows($result); $i++) {
         $row = $db->query_result_rowdata($result, $i);
         $moduleName = Vtiger_Functions::getModuleName($row['tabid']);
         if ($moduleName != 'Home' && ($row['linklabel'] == 'Mini List' || $row['linklabel'] == 'Notebook')) {
             continue;
         }
         if ($row['linklabel'] == 'Tag Cloud') {
             $isTagCloudExists = getTagCloudView($currentUser->getId());
             if ($isTagCloudExists == 'false') {
                 continue;
             }
         }
         $moduleName = Vtiger_Functions::getModuleName($row['tabid']);
         $widgets[$moduleName][] = Vtiger_Widget_Model::getInstanceFromValues($row);
     }
     $log->debug("Exiting Settings_WidgetsManagement_Module_Model::getSelectableDashboard() method ...");
     return $widgets;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:28,代码来源:Module.php

示例4: getKeyMetricsWithCount

 protected function getKeyMetricsWithCount()
 {
     global $log;
     $log->debug("Entering ./dashboards/KeyMetrics.php::getKeyMetricsWithCount");
     global $current_user, $adb;
     $current_user = Users_Record_Model::getCurrentUserModel();
     require_once 'modules/CustomView/ListViewTop.php';
     $metriclists = getMetricList();
     foreach ($metriclists as $key => $metriclist) {
         $metricresult = NULL;
         $queryGenerator = new QueryGenerator($metriclist['module'], $current_user);
         $queryGenerator->initForCustomViewById($metriclist['id']);
         if ($metriclist['module'] == "Calendar") {
             // For calendar we need to eliminate emails or else it will break in status empty condition
             $queryGenerator->addCondition('activitytype', "Emails", 'n', QueryGenerator::$AND);
         }
         $metricsql = $queryGenerator->getQuery();
         $metricresult = $adb->query(Vtiger_Functions::mkCountQuery($metricsql));
         if ($metricresult) {
             $rowcount = $adb->fetch_array($metricresult);
             $metriclists[$key]['count'] = $rowcount['count'];
         }
     }
     return $metriclists;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:25,代码来源:KeyMetrics.php

示例5: edit

 public function edit(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $qualifiedModuleName = $request->getModule(false);
     $wid = $request->get('id');
     $moduleModel = Settings_Widgets_Module_Model::getInstance($qualifiedModuleName);
     $WidgetInfo = $moduleModel->getWidgetInfo($wid);
     $RelatedModule = $moduleModel->getRelatedModule($WidgetInfo['tabid']);
     $type = $WidgetInfo['type'];
     $viewer = $this->getViewer($request);
     $viewer->assign('SOURCE', $WidgetInfo['tabid']);
     $viewer->assign('SOURCEMODULE', Vtiger_Functions::getModuleName($WidgetInfo['tabid']));
     $viewer->assign('WID', $wid);
     $viewer->assign('WIDGETINFO', $WidgetInfo);
     $viewer->assign('TYPE', $type);
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
     $viewer->assign('RELATEDMODULES', $RelatedModule);
     $widgetName = 'Vtiger_' . $type . '_Widget';
     if (class_exists($widgetName)) {
         $widgetInstance = new $widgetName();
         $tplName = $widgetInstance->getConfigTplName();
         $viewer->view("widgets/{$tplName}.tpl", 'Vtiger');
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:26,代码来源:Widget.php

示例6: process

 function process(Vtiger_Request $request)
 {
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $baseUserId = $currentUserModel->getId();
     $userId = $request->get('id');
     $user = new Users();
     $currentUser = $user->retrieveCurrentUserInfoFromFile($userId);
     $name = $currentUserModel->getName();
     $userName = $currentUser->column_fields['user_name'];
     Vtiger_Session::set('AUTHUSERID', $userId);
     Vtiger_Session::set('authenticated_user_id', $userId);
     Vtiger_Session::set('user_name', $userName);
     Vtiger_Session::set('full_user_name', $name);
     $status = 'Switched';
     if (Vtiger_Session::get('baseUserId') == '') {
         Vtiger_Session::set('baseUserId', $baseUserId);
         $status = 'Signed in';
     } elseif ($userId == Vtiger_Session::get('baseUserId')) {
         $baseUserId = $userId;
         Vtiger_Session::set('baseUserId', '');
         $status = 'Signed out';
     } else {
         $baseUserId = Vtiger_Session::get('baseUserId');
     }
     $dbLog = PearDatabase::getInstance('log');
     $dbLog->insert('l_yf_switch_users', ['baseid' => $baseUserId, 'destid' => $userId, 'busername' => $currentUserModel->getName(), 'dusername' => $name, 'date' => date('Y-m-d H:i:s'), 'ip' => Vtiger_Functions::getRemoteIP(), 'agent' => $_SERVER['HTTP_USER_AGENT'], 'status' => $status]);
     header('Location: index.php');
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:28,代码来源:SwitchUsers.php

示例7: getDisplayValue

 /**
  * Getting value to display
  * @param type $value
  * @return type
  */
 public function getDisplayValue($value)
 {
     if ($value != 0) {
         return Vtiger_Functions::getCRMRecordLabel($value);
     }
     return '';
 }
开发者ID:noclav,项目名称:UpdatePackages,代码行数:12,代码来源:Reference.php

示例8: process

 public function process(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $qualifiedModuleName = $request->getModule(false);
     $source = $request->get('source');
     $sourceModule = $request->get('sourceModule');
     if ($sourceModule != '') {
         $source = Vtiger_Functions::getModuleId($sourceModule);
     }
     if ($source == '') {
         $source = 6;
     }
     $moduleModel = Settings_Widgets_Module_Model::getInstance($qualifiedModuleName);
     $RelatedModule = $moduleModel->getRelatedModule($source);
     $viewer = $this->getViewer($request);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     $viewer->assign('SOURCE', $source);
     $viewer->assign('SOURCEMODULE', Vtiger_Functions::getModuleName($source));
     $viewer->assign('WIDGETS', $moduleModel->getWidgets($source));
     $viewer->assign('RELATEDMODULES', $RelatedModule);
     $viewer->assign('FILTERS', json_encode($moduleModel->getFiletrs($RelatedModule)));
     $viewer->assign('CHECKBOXS', json_encode($moduleModel->getCheckboxs($RelatedModule)));
     //$viewer->assign('EXCLUDEDTYPES', $moduleModel->excludedTypes($source) );
     $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
     $viewer->assign('MODULE', $moduleName);
     $viewer->view('Index.tpl', $qualifiedModuleName);
 }
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:27,代码来源:Index.php

示例9: process

 function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $this->getModule($request);
     $template = $request->get('template');
     $srcField = $request->get('src_field');
     $srcRecord = $request->get('src_record');
     if (!empty($template)) {
         $recordModel = Settings_TreesManager_Record_Model::getInstanceById($template);
     } else {
         Vtiger_Functions::throwNewException(vtranslate('ERR_TREE_NOT_FOUND', $moduleName));
     }
     if (!$recordModel) {
         Vtiger_Functions::throwNewException(vtranslate('ERR_TREE_NOT_FOUND', $moduleName));
     }
     $tree = $recordModel->getTree();
     $viewer->assign('TREE', Zend_Json::encode($tree));
     $viewer->assign('SRC_RECORD', $srcRecord);
     $viewer->assign('SRC_FIELD', $srcField);
     $viewer->assign('TEMPLATE', $template);
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('TRIGGER_EVENT_NAME', $request->get('triggerEventName'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->view('TreePopup.tpl', $moduleName);
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:25,代码来源:TreePopup.php

示例10: showTree

 public function showTree(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $sourceModule = $request->get('selectedModule');
     $viewer = $this->getViewer($request);
     $this->template = $this->getTemplate();
     if ($this->template) {
         $recordModel = Settings_TreesManager_Record_Model::getInstanceById($this->template);
     } else {
         Vtiger_Functions::throwNewException(vtranslate('ERR_TREE_NOT_FOUND', $moduleName));
     }
     if (!$recordModel) {
         Vtiger_Functions::throwNewException(vtranslate('ERR_TREE_NOT_FOUND', $moduleName));
     }
     if (!in_array($sourceModule, $this->modules)) {
         Vtiger_Functions::throwNewException(vtranslate('ERR_MODULE_NOT_FOUND', $moduleName));
     }
     $tree = $this->getCategory();
     $treeWithItems = $this->getRecords();
     $tree = array_merge($tree, $treeWithItems);
     $viewer->assign('TREE', Zend_Json::encode($tree));
     $viewer->assign('MODULES', $this->modules);
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('SELECTED_MODULE_NAME', $sourceModule);
     $viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($moduleName));
     $viewer->view('AccountsListTree.tpl', $moduleName);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:27,代码来源:AccountsListTree.php

示例11: getKeyMetricsWithCount

 protected function getKeyMetricsWithCount()
 {
     global $current_user, $adb;
     $current_user = Users_Record_Model::getCurrentUserModel();
     require_once 'modules/CustomView/ListViewTop.php';
     $metriclists = getMetricList();
     foreach ($metriclists as $key => $metriclist) {
         $metricresult = NULL;
         if ($metriclist['module'] == "Calendar") {
             $listquery = getListQuery($metriclist['module']);
             $oCustomView = new CustomView($metriclist['module']);
             $metricsql = $oCustomView->getModifiedCvListQuery($metriclist['id'], $listquery, $metriclist['module']);
             $metricresult = $adb->query(Vtiger_Functions::mkCountQuery($metricsql));
         } else {
             $queryGenerator = new QueryGenerator($metriclist['module'], $current_user);
             $queryGenerator->initForCustomViewById($metriclist['id']);
             $metricsql = $queryGenerator->getQuery();
             $metricresult = $adb->query(Vtiger_Functions::mkCountQuery($metricsql));
         }
         if ($metricresult) {
             $rowcount = $adb->fetch_array($metricresult);
             $metriclists[$key]['count'] = $rowcount['count'];
         }
     }
     return $metriclists;
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:26,代码来源:Notebook.php

示例12: getDisplayValue

	/**
	 * Function to get the Display Value, for the current field type with given DB Insert Value
	 * @param <Object> $value
	 * @return <Object>
	 */
	public function getDisplayValue($values)
	{
		if ($values == '')
			return;

		foreach (Vtiger_Functions::getArrayFromValue($values) as $value) {
			if (Vtiger_Owner_UIType::getOwnerType($value) === 'User') {
				$userModel = Users_Record_Model::getCleanInstance('Users');
				$userModel->set('id', $value);
				$detailViewUrl = $userModel->getDetailViewUrl();
				$currentUser = Users_Record_Model::getCurrentUserModel();
				if ($currentUser->isAdminUser()) {
					$displayvalue[] = '<a href=' . $detailViewUrl . '>' . rtrim(getOwnerName($value)) . '</a>';
				} else {
					$displayvalue[] = rtrim(getOwnerName($value));
				}
			} else {
				$currentUser = Users_Record_Model::getCurrentUserModel();
				if ($currentUser->isAdminUser()) {
					$recordModel = new Settings_Groups_Record_Model();
					$recordModel->set('groupid', $value);
					$detailViewUrl = $recordModel->getDetailViewUrl();
					$displayvalue[] = '<a href=' . $detailViewUrl . '>' . rtrim(getOwnerName($value)) . '</a>';
				} else {
					$displayvalue[] = rtrim(getOwnerName($value));
				}
			}
		}
		$displayvalue = implode(', ', $displayvalue);
		return $displayvalue;
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:36,代码来源:SharedOwner.php

示例13: addRelation

 function addRelation($request)
 {
     $sourceModule = $request->getModule();
     $sourceRecordId = $request->get('src_record');
     $relatedModule = $request->get('related_module');
     if (is_numeric($relatedModule)) {
         $relatedModule = Vtiger_Functions::getModuleName($relatedModule);
     }
     $relatedRecordIdList = $request->get('related_record_list');
     $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);
     $relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);
     $relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);
     foreach ($relatedRecordIdList as $relatedRecordId) {
         $relationModel->addRelation($sourceRecordId, $relatedRecordId, $listPrice);
         if ($relatedModule == 'PriceBooks') {
             $recordModel = Vtiger_Record_Model::getInstanceById($relatedRecordId);
             if ($sourceRecordId && ($sourceModule === 'Products' || $sourceModule === 'Services')) {
                 $parentRecordModel = Vtiger_Record_Model::getInstanceById($sourceRecordId, $sourceModule);
                 $recordModel->updateListPrice($sourceRecordId, $parentRecordModel->get('unit_price'));
             }
         }
     }
     $response = new Vtiger_Response();
     $response->setResult(true);
     $response->emit();
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:26,代码来源:RelationAjax.php

示例14: process

	public function process(Vtiger_Request $request)
	{
		$qualifiedModuleName = $request->getModule(false);
		$moduleModel = Settings_Vtiger_CompanyDetails_Model::getInstance();
		$status = false;

		if ($request->get('organizationname')) {
			$saveLogo = $status = true;
			if (!empty($_FILES['logo']['name'])) {
				$logoDetails = $_FILES['logo'];
				$fileType = explode('/', $logoDetails['type']);
				$fileType = $fileType[1];

				if (!$logoDetails['size'] || !in_array($fileType, Settings_Vtiger_CompanyDetails_Model::$logoSupportedFormats)) {
					$saveLogo = false;
				}

				//mime type check 
				$mimeType = Vtiger_Functions::getMimeContentType($logoDetails['tmp_name']);
				$mimeTypeContents = explode('/', $mimeType);
				if (!$logoDetails['size'] || $mimeTypeContents[0] != 'image' || !in_array($mimeTypeContents[1], Settings_Vtiger_CompanyDetails_Model::$logoSupportedFormats)) {
					$saveLogo = false;
				}

				// Check for php code injection
				$imageContents = file_get_contents($_FILES["logo"]["tmp_name"]);
				if (preg_match('/(<\?php?(.*?))/i', $imageContents) == 1) {
					$saveLogo = false;
				}
				if ($saveLogo) {
					$moduleModel->saveLogo();
				}
			} else {
				$saveLogo = true;
			}
			$fields = $moduleModel->getFields();
			foreach ($fields as $fieldName => $fieldType) {
				$fieldValue = $request->get($fieldName);
				if ($fieldName === 'logoname') {
					if (!empty($logoDetails['name'])) {
						$fieldValue = ltrim(basename(" " . $logoDetails['name']));
					} else {
						$fieldValue = $moduleModel->get($fieldName);
					}
				}
				$moduleModel->set($fieldName, $fieldValue);
			}
			$moduleModel->save();
		}

		$reloadUrl = $moduleModel->getIndexViewUrl();
		if ($saveLogo && $status) {
			
		} else if (!$saveLogo) {
			$reloadUrl .= '&error=LBL_INVALID_IMAGE';
		} else {
			$reloadUrl = $moduleModel->getEditViewUrl() . '&error=LBL_FIELDS_INFO_IS_EMPTY';
		}
		header('Location: ' . $reloadUrl);
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:60,代码来源:CompanyDetailsSave.php

示例15: getRelatedSummary

 public function getRelatedSummary($query)
 {
     $db = PearDatabase::getInstance();
     $relationQuery = preg_replace("/[ \t\n\r]+/", " ", $query);
     $position = stripos($relationQuery, ' from ');
     if ($position) {
         $split = explode(' FROM ', $relationQuery);
         $mainQuery = '';
         for ($i = 1; $i < count($split); $i++) {
             $mainQuery = $mainQuery . ' FROM ' . $split[$i];
         }
     }
     // Calculate total working time
     $result = $db->query('SELECT SUM(vtiger_osstimecontrol.sum_time) AS sumtime' . $mainQuery);
     $totalTime = $db->getSingleValue($result);
     // Calculate total working time divided into users
     $result = $db->query('SELECT SUM(vtiger_osstimecontrol.sum_time) AS sumtime, vtiger_crmentity.smownerid' . $mainQuery . ' GROUP BY vtiger_crmentity.smownerid');
     $userTime = [];
     $count = 1;
     while ($row = $db->fetch_array($result)) {
         $smownerid = Vtiger_Functions::getOwnerRecordLabel($row['smownerid']);
         $userTime[] = ['name' => [$count, $smownerid], 'initial' => [$count, Vtiger_Functions::getInitials($smownerid)], 'data' => [$count, $row['sumtime']]];
         $count++;
     }
     return ['totalTime' => $totalTime, 'userTime' => $userTime];
 }
开发者ID:reeid,项目名称:YetiForceCRM,代码行数:26,代码来源:Module.php


注:本文中的Vtiger_Functions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。