コード例 #1
0
ファイル: ModuleMeta.php プロジェクト: cin-system/cinrepo
 /**
  * Function returns Entity Name fields
  * @return <Array of Vtiger_Field>
  */
 public function getEntityFields()
 {
     global $log;
     $log->debug("Entering ./models/ModuleMeta.php::getEntityFields");
     $moduleFields = $this->getAccessibleFields($this->moduleName);
     $entityColumnNames = vtws_getEntityNameFields($this->moduleName);
     $entityNameFields = array();
     foreach ($moduleFields as $fieldName => $fieldInstance) {
         $fieldColumnName = $fieldInstance->getColumnName();
         if (in_array($fieldColumnName, $entityColumnNames)) {
             $entityNameFields[$fieldName] = $fieldInstance;
         }
     }
     return $entityNameFields;
 }
コード例 #2
0
	public function getEntityFields($moduleName) {
		$moduleFields = $this->getAccessibleFields($moduleName);
		$entityColumnNames = vtws_getEntityNameFields($moduleName);
		$entityNameFields = array();
		foreach($moduleFields as $fieldName => $fieldInstance) {
			$fieldColumnName = $fieldInstance->getColumnName();
			if(in_array($fieldColumnName, $entityColumnNames)) {
				$entityNameFields[$fieldName] = $fieldInstance;
			}
		}
		return $entityNameFields;
	}
コード例 #3
0
global $focus_list;
if (!isset($where)) {
    $where = "";
}
$url_string = '';
$smarty = new vtigerCRM_Smarty();
$smarty->assign("subject", $_REQUEST['subject']);
$smarty->assign("description", $_REQUEST['description']);
Zend_Json::$useBuiltinEncoderDecoder = true;
$json = new Zend_Json();
$elementType = $_REQUEST['module'];
global $log, $adb;
$webserviceObject = VtigerWebserviceObject::fromName($adb, $elementType);
$handlerPath = $webserviceObject->getHandlerPath();
$handlerClass = $webserviceObject->getHandlerClass();
require_once $handlerPath;
$handler = new $handlerClass($webserviceObject, $current_user, $adb, $log);
$meta = $handler->getMeta();
$meta->retrieveMeta();
$types = vtws_listtypes($current_user);
if (!in_array($elementType, $types['types'])) {
    throw new WebServiceException(WebServiceErrorCode::$ACCESSDENIED, "Permission to perform the operation is denied");
}
$wsFieldDetails = $handler->getField('parent_id');
$moduleEntityNameDetails = array();
foreach ($wsFieldDetails['type']['refersTo'] as $type) {
    $moduleEntityNameDetails[$type] = vtws_getEntityNameFields($type);
}
$smarty->assign("types", $wsFieldDetails['type']['refersTo']);
$smarty->assign("entityNameFields", $json->encode($moduleEntityNameDetails));
$smarty->display("modules/Bookmarklet/Bookmarklet.tpl");