Function convertToNativeLink
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function convertToNativeLink()
{
$url = $this->get('linkurl');
if (empty($url)) {
return $url;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The class Vtiger_Link_Model has an overall complexity of 76 which is very high. The configured complexity threshold is 50. Open
class Vtiger_Link_Model extends vtlib\Link
{
// Class variable to store the child links
protected $childlinks = [];
- Exclude checks
Method convertToNativeLink
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function convertToNativeLink()
{
$url = $this->get('linkurl');
if (empty($url)) {
return $url;
Vtiger_Link_Model
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Vtiger_Link_Model extends vtlib\Link
{
// Class variable to store the child links
protected $childlinks = [];
Function getAllByType
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getAllByType($tabid, $type = [], $parameters = false)
{
$links = Vtiger_Cache::get('links-' . $tabid, $type);
if (!$links) {
$links = parent::getAllByType($tabid, $type, $parameters);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getInstanceFromLinkObject
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getInstanceFromLinkObject(vtlib\Link $linkObj)
{
$objectProperties = get_object_vars($linkObj);
$linkModel = new self();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The method convertToNativeLink() has an NPath complexity of 276640. The configured NPath complexity threshold is 200. Open
public function convertToNativeLink()
{
$url = $this->get('linkurl');
if (empty($url)) {
return $url;
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method convertToNativeLink() has a Cyclomatic Complexity of 28. The configured cyclomatic complexity threshold is 10. Open
public function convertToNativeLink()
{
$url = $this->get('linkurl');
if (empty($url)) {
return $url;
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method getAllByType() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
public static function getAllByType($tabid, $type = [], $parameters = false)
{
$links = Vtiger_Cache::get('links-' . $tabid, $type);
if (!$links) {
$links = parent::getAllByType($tabid, $type, $parameters);
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Refactor this function to reduce its Cognitive Complexity from 45 to the 15 allowed. Open
public function convertToNativeLink()
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Class "Vtiger_Link_Model" has 23 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class Vtiger_Link_Model extends vtlib\Link
- Read upRead up
- Exclude checks
A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.
The method getRelatedModuleName has a boolean flag argument $defaultModuleName, which is a certain sign of a Single Responsibility Principle violation. Open
public function getRelatedModuleName($defaultModuleName = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method getAllByType has a boolean flag argument $parameters, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getAllByType($tabid, $type = [], $parameters = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid using static access to class '\App\Layout' in method 'getInstanceFromLinkObject'. Open
$filePath1 = str_replace('_layoutName_', \App\Layout::getActiveLayout(), $linkModel->linkurl);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getRelatedModuleName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$relatedModuleName = $this->relatedModuleName;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'Vtiger_Module_Model' in method 'convertToNativeLink'. Open
$relatedModuleModel = Vtiger_Module_Model::getInstance($module);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'Vtiger_Cache' in method 'getAllByType'. Open
$links = Vtiger_Cache::get('links-' . $tabid, $type);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Json' in method 'getInstanceFromLinkObject'. Open
$params = \App\Json::decode($objectProperties['params']);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'vtlib\Functions' in method 'getRelatedModuleName'. Open
$queryParams = vtlib\Functions::getQueryParams($this->get('linkurl'));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'Vtiger_Theme' in method 'getIconPath'. Open
return Vtiger_Theme::getImagePath($this->getIcon());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'Vtiger_Relation_Model' in method 'convertToNativeLink'. Open
$relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'Vtiger_Cache' in method 'getAllByType'. Open
Vtiger_Cache::set('links-' . $tabid, $type, $links);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Privilege' in method 'getAllByType'. Open
if ((empty($type) || \in_array($linkType, $type)) && !(isset($queryParams['module']) && !\App\Privilege::isPermitted($queryParams['module']))) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Purifier' in method 'convertToNativeLink'. Open
return \App\Purifier::encodeHtml($url);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'Vtiger_Module_Model' in method 'convertToNativeLink'. Open
$sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Purifier' in method 'convertToNativeLink'. Open
return \App\Purifier::encodeHtml(implode('&', $parametersParts));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Layout' in method 'getInstanceFromLinkObject'. Open
$filePath2 = str_replace('_layoutName_', \App\Layout::getActiveLayout(), $linkModel->linkurl);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'vtlib\Functions' in method 'getAllByType'. Open
$queryParams = vtlib\Functions::getQueryParams($linkObject->linkurl);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Define a constant instead of duplicating this literal "parent" 3 times. Open
if (0 === strcmp($key, 'parent')) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "module" 6 times. Open
if (0 === strcmp($key, 'module') || 0 === strcmp($key, 'index.php?module')) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "params" 3 times. Open
if (!empty($objectProperties['params'])) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "linkurl" 3 times. Open
$url = $this->get('linkurl');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "_layoutName_" 3 times. Open
if (false !== strpos($linkModel->linkurl, '_layoutName_')) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Reference to undeclared property \Vtiger_Link_Model->relatedModuleName
Open
$this->relatedModuleName = $parent ? "$parent:$module" : $module;
- Exclude checks
Reference to undeclared property \Vtiger_Link_Model->relatedModuleName
Open
if (!empty($module) && !isset($this->relatedModuleName)) {
- Exclude checks
Method \Vtiger_Link_Model::hasChild
is declared to return bool
but has no return value Open
public function hasChild()
- Exclude checks
Class \vtlib\Link
was passed to foreach, but it does not extend Traversable. This may be intentional, because some of that class's declared properties are accessible from this context. (This check excludes dynamic properties) Open
foreach ($linkObjects as $linkObject) {
- Exclude checks
Reference to undeclared property \Vtiger_Link_Model->relatedModuleName
(Did you mean $relatedModuleName) Open
if (empty($this->relatedModuleName)) {
- Exclude checks
Saw unextractable annotation for comment '* @return <class name>'</class>
Open
* @return <class name>
- Exclude checks
Reference to undeclared property \Vtiger_Link_Model->relatedModuleName
(Did you mean $relatedModuleName) Open
$this->relatedModuleName = $relatedModuleName = isset($queryParams['parent']) ? $queryParams['parent'] . ':' . $queryParams['module'] : $queryParams['module'];
- Exclude checks
Saw unextractable annotation for comment '* @param <object> $propertyValue'</object>
Open
* @param <Object> $propertyValue
- Exclude checks
Saw unextractable annotation for comment '* @return <string> - returns image path if icon exits'</string>
Open
* @return <String/Boolean> - returns image path if icon exits
- Exclude checks
Saw unextractable annotation for comment '* @return <class name>'</class>
Open
* @return <class name>
- Exclude checks
Saw unextractable annotation for comment '* @return <number>'</number>
Open
* @return <Number>
- Exclude checks
Reference to undeclared property \Vtiger_Link_Model->active
Open
return $this->active ?? true;
- Exclude checks
Reference to undeclared property \Vtiger_Link_Model->relatedModuleName
(Did you mean $relatedModuleName) Open
$relatedModuleName = $this->relatedModuleName;
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Vtiger_Link_Model extends vtlib\Link
- Exclude checks
The class Vtiger_Link_Model is not named in CamelCase. Open
class Vtiger_Link_Model extends vtlib\Link
{
// Class variable to store the child links
protected $childlinks = [];
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the link url.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->linkicon;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $propertyName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_Link_Model instance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to check whether link is active.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the link type.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param <Object> $propertyValue
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the link label.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the link header icon name.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to check whether link has icon or not.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isIconExists()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkIcon = $this->getIcon();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return property_exists($this, $propertyName) ? $this->{$propertyName} : '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->{$propertyName} = $propertyValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getUrl()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getLabel()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Class variable to store the child links
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool true/false
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->linklabel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function get($propertyName)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function set($propertyName, $propertyValue)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->icon;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($linkIcon)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getType()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the value of a given property.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the link icon name.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $childlinks = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws Exception
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isActive()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->linktype;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->active ?? true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $propertyName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to set the value of a given property.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->convertToNativeLink();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getIcon()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getHeaderIcon()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the link id.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to Add link to the child link list.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Indicating that it is an relation operation
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === strcmp($key, 'sourceRecord')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($fieldList as $fieldModel) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getGrupClassName()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getId()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$module = $parent = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === strcmp($key, 'return_module')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === strcmp($key, 'sourceModule')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newUrlParts[] = $key;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($relationModel && $relationModel->isDirectRelation()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this->isPageLoadLink()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
continue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = $urlParts[1];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === strcmp($key, 'action') && strpos($value, 'View')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parent = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$referenceList = $fieldModel->getReferenceList();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return <String/Boolean> - returns image path if icon exits
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* else returns false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this->isIconExists()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getClassName()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @result Vtiger_Link_Model - current Instance;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function convertToNativeLink()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$key = $urlParts[0];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newUrlParts = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parametersParts[$index] = implode('=', $newUrlParts);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->linkid;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param Vtiger_Link_Model $link - link model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceModule = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getChildLinks()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//to append the reference field in one to many relation
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldList = $relatedModuleModel->getFields();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return <class name>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isPageLoadLink()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url = $this->get('linkurl');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $url;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceRecord = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parametersParts = explode('&', $url);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newUrlParts[] = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getIconPath()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function addChildLink(self $link)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Check if the link is not javascript
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the Class Name.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return <Number>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get all the child links.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === strcmp($key, 'parent')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($fieldModel->isReferenceField()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to retrieve the icon path for the link icon.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the grup Class Name.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->childlinks[] = $link;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//See if indexing is need depending only user selection
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$module = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parametersParts[] = 'relationOperation=true';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === strcmp($key, 'return_id')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->get('linkclass') ?? '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->childlinks;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
(\count($this->childlinks) > 0) ? true : false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false === strpos($keyValue, '=')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = str_replace('View', '', $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceModule = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relatedModuleModel = Vtiger_Module_Model::getInstance($module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return Vtiger_Theme::getImagePath($this->getIcon());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @result <array> - list of Vtiger_Link_Model instances
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === strcmp($key, 'module') || 0 === strcmp($key, 'index.php?module')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$key = 'view';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$key = 'sourceRecord';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($value) || 0 == $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($module) && !empty($sourceModule) && !empty($sourceRecord) && empty($parent)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url = $this->get('linkurl');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($parametersParts as $index => $keyValue) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$urlParts = explode('=', $keyValue);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceRecord = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return <class name>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function setChildLink($links)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to check whether the link model has any child links.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function hasChild()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === strpos($url, 'index')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Convert to native link.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//To convert single quotes and double quotes
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Purifier::encodeHtml($url);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->get('linkgrupclass');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->childlinks = $links;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool true/false
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($url)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$key = 'sourceModule';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getAllByType($tabid, $type = [], $parameters = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($links as $linkType => $linkObjects) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relatedModuleName = $defaultModuleName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Purifier::encodeHtml(implode('&', $parametersParts));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param vtlib\Link $linkObj
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($objectProperties['params']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $linkModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $linkModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $tabid
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$links = Vtiger_Cache::get('links-' . $tabid, $type);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getRelatedModuleName($defaultModuleName = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->relatedModuleName = $relatedModuleName = isset($queryParams['parent']) ? $queryParams['parent'] . ':' . $queryParams['module'] : $queryParams['module'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkModel->{$properName} = $propertyValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkModel->linkurl = $filePath2;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkModels[$linkType][] = self::getInstanceFromLinkObject($linkObject);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $defaultModuleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($module) && !isset($this->relatedModuleName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_Link_Model instance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_Link_Model instance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
} elseif (is_file(ROOT_DIRECTORY . DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . $filePath2)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get all the Vtiger Link Models for a module of the given list of link types.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($type as $element) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($linkObjects as $linkObject) {
- Exclude checks
Line exceeds 120 characters; contains 175 characters Open
$this->relatedModuleName = $relatedModuleName = isset($queryParams['parent']) ? $queryParams['parent'] . ':' . $queryParams['module'] : $queryParams['module'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relatedModuleName = $this->relatedModuleName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkModel = new self();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkModel->{$property} = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstanceFromLinkObject(vtlib\Link $linkObj)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Vtiger_Cache::set('links-' . $tabid, $type, $links);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the relatedModuleName.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkModel = new self();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string[] $type
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkModel->initialize($valueMap);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($valueMap as $property => $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the instance of Vtiger Link Model from a given vtlib\Link object.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (is_file(ROOT_DIRECTORY . DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . $filePath2)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool|array $parameters
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePath1 = str_replace('_layoutName_', \App\Layout::getActiveLayout(), $linkModel->linkurl);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ((empty($type) || \in_array($linkType, $type)) && !(isset($queryParams['module']) && !\App\Privilege::isPermitted($queryParams['module']))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryParams = vtlib\Functions::getQueryParams($this->get('linkurl'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($objectProperties['params'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// added support for multilayout
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkModel->linkurl = $filePath1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parametersParts[] = $fieldModel->get('name') . '=' . $sourceRecord;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//To convert single quotes and double quotes
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the instance of Vtiger Link Model from the given array of key-value mapping.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$objectProperties = get_object_vars($linkObj);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (is_file(ROOT_DIRECTORY . DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . $filePath1)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($this->relatedModuleName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_Link_Model[] - List of Vtiger_Link_Model instances
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$links = parent::getAllByType($tabid, $type, $parameters);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkModels[$element] = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\in_array($sourceModuleModel->get('name'), $referenceList)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->relatedModuleName = $parent ? "$parent:$module" : $module;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// To set other properties for Link Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($params)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $linkModels;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($queryParams['module'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $relatedModuleName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = \App\Json::decode($objectProperties['params']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($objectProperties as $properName => $propertyValue) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== strpos($linkModel->linkurl, '_layoutName_')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkModels = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $valueMap
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePath2 = str_replace('_layoutName_', \App\Layout::getActiveLayout(), $linkModel->linkurl);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($type)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryParams = vtlib\Functions::getQueryParams($linkObject->linkurl);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstanceFromValues($valueMap)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($linkModel->{$property})) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($params as $properName => $propertyValue) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$linkModel->{$properName} = $propertyValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$links) {
- Exclude checks
Line exceeds 120 characters; contains 160 characters Open
if ((empty($type) || \in_array($linkType, $type)) && !(isset($queryParams['module']) && !\App\Privilege::isPermitted($queryParams['module']))) {
- Exclude checks
Class name "Vtiger_Link_Model" is not in camel caps format Open
class Vtiger_Link_Model extends vtlib\Link
- Exclude checks