本文整理汇总了PHP中Vtiger_Field_Model::getAllForModule方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Field_Model::getAllForModule方法的具体用法?PHP Vtiger_Field_Model::getAllForModule怎么用?PHP Vtiger_Field_Model::getAllForModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Field_Model
的用法示例。
在下文中一共展示了Vtiger_Field_Model::getAllForModule方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFields
public function getFields()
{
if (empty($this->fields)) {
$moduleFields = Vtiger_Field_Model::getAllForModule($this->module);
$this->fields = array();
// if block does not contains any fields
if (!is_array($moduleFields[$this->id])) {
$moduleFields[$this->id] = array();
}
foreach ($moduleFields[$this->id] as $field) {
$this->fields[$field->get('name')] = $field;
}
}
return $this->fields;
}
示例2: getFields
public function getFields()
{
global $log;
$log->debug("Entering ./models/Block.php::getFields");
if (empty($this->fields)) {
$moduleFields = Vtiger_Field_Model::getAllForModule($this->module);
$this->fields = array();
// if block does not contains any fields
if (!is_array($moduleFields[$this->id])) {
$moduleFields[$this->id] = array();
}
foreach ($moduleFields[$this->id] as $field) {
$this->fields[$field->get('name')] = $field;
}
}
return $this->fields;
}
示例3: getRecordDetail
public function getRecordDetail($record)
{
$moduleName = $this->api->getModuleName();
$user = new Users();
$currentUser = $user->retrieveCurrentUserInfoFromFile(Users::getActiveAdminId());
vglobal('current_user', $currentUser);
$recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
$rawData = $recordModel->getData();
$moduleModel = $recordModel->getModule();
$fields = [];
$moduleBlockFields = Vtiger_Field_Model::getAllForModule($moduleModel);
foreach ($moduleBlockFields as $moduleFields) {
foreach ($moduleFields as $moduleField) {
$block = $moduleField->get('block');
$fields[$block->label][$moduleField->get('name')] = $rawData[$moduleField->get('name')];
if (empty($block)) {
continue;
}
}
}
return ['rawData' => $rawData, 'data' => $fields];
}
示例4: getFields
/**
* Function that returns all the fields for the module
* @return <Array of Vtiger_Field_Model> - list of field models
*/
public function getFields($blockInstance = false)
{
if (empty($this->fields)) {
$moduleBlockFields = Vtiger_Field_Model::getAllForModule($this);
$this->fields = array();
foreach ($moduleBlockFields as $moduleFields) {
foreach ($moduleFields as $moduleField) {
$block = $moduleField->get('block');
if (empty($block)) {
continue;
}
$this->fields[$moduleField->get('name')] = $moduleField;
}
}
}
return $this->fields;
}
示例5: importData
public function importData()
{
$focus = CRMEntity::getInstance($this->module);
$moduleModel = Vtiger_Module_Model::getInstance($this->module);
// pre fetch the fields and premmisions of module
Vtiger_Field_Model::getAllForModule($moduleModel);
if ($this->user->is_admin == 'off') {
Vtiger_Field_Model::preFetchModuleFieldPermission($moduleModel->getId());
}
if (method_exists($focus, 'createRecords')) {
$focus->createRecords($this);
} else {
$this->createRecords();
}
$this->updateModuleSequenceNumber();
}
示例6: setDefaultValue
function setDefaultValue($module, $moduleObj)
{
$moduleInstance = Vtiger_Module_Model::getInstance($module);
$fieldInstances = Vtiger_Field_Model::getAllForModule($moduleInstance);
foreach ($fieldInstances as $blockInstance) {
foreach ($blockInstance as $fieldInstance) {
$fieldName = $fieldInstance->getName();
$defaultValue = $fieldInstance->getDefaultFieldValue();
if ($defaultValue) {
$moduleObj->column_fields[$fieldName] = decode_html($defaultValue);
}
if ($fieldInstance->isMandatory() && !$defaultValue) {
$moduleObj->column_fields[$fieldName] = Vtiger_Util_Helper::getDefaultMandatoryValue($fieldInstance->getFieldDataType());
}
}
}
}