Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Creation of dynamic property in Module.php, Record.php, Basic.php #17220

Merged
merged 2 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions modules/Vtiger/models/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class Vtiger_Module_Model extends \vtlib\Module
const ADVANCED_TYPE = 1;
/** @var bool */
public $allowTypeChange = true;

protected $blocks;
protected $nameFields;
protected $moduleMeta;
Expand Down Expand Up @@ -652,16 +651,13 @@ public function getFieldsForSave(Vtiger_Record_Model $recordModel)
*/
public function getSummaryViewFieldsList()
{
if (!isset($this->summaryFields)) {
$summaryFields = [];
foreach ($this->getFields() as $fieldName => &$fieldModel) {
if ($fieldModel->isSummaryField() && $fieldModel->isActiveField()) {
$summaryFields[$fieldName] = $fieldModel;
}
$summaryFields = [];
foreach ($this->getFields() as $fieldName => &$fieldModel) {
if ($fieldModel->isSummaryField() && $fieldModel->isActiveField()) {
$summaryFields[$fieldName] = $fieldModel;
}
$this->summaryFields = $summaryFields;
}
return $this->summaryFields;
return $summaryFields;
}

/**
Expand Down
14 changes: 9 additions & 5 deletions modules/Vtiger/models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
class Vtiger_Record_Model extends \App\Base
{
/** @var Vtiger_Record_Model Instance of the recrod */
protected $entity;
/**
* @var string Record label
*/
Expand Down Expand Up @@ -211,13 +213,15 @@ public function getSearchName()
return \App\Purifier::encodeHtml(App\Purifier::decodeHtml($displayName));
}

/**
* Track changes in record.
*
* @return bool
*/
public function isWatchingRecord()
{
if (!isset($this->isWatchingRecord)) {
$watchdog = Vtiger_Watchdog_Model::getInstanceById($this->getId(), $this->getModuleName());
$this->isWatchingRecord = (bool) $watchdog->isWatchingRecord();
}
return $this->isWatchingRecord;
$watchdog = Vtiger_Watchdog_Model::getInstanceById($this->getId(), $this->getModuleName());
return (bool) $watchdog->isWatchingRecord();
}

/**
Expand Down
2 changes: 2 additions & 0 deletions modules/Vtiger/widgets/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class Vtiger_Basic_Widget
public $Module = false;
public $Record = false;
public $Config = [];
/** @var int Data widget.. */
public $Data;
public $moduleModel = false;
public $dbParams = [];
public $allowedModules = [];
Expand Down
Loading