File Rule.php
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Settings SharingAccess rule model class.
*
* @copyright YetiForce S.A.
Settings_SharingAccess_Rule_Model
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Settings_SharingAccess_Rule_Model extends \App\Base
{
const RULE_TYPE_GROUPS = 'GRP';
const RULE_TYPE_ROLE = 'ROLE';
const RULE_TYPE_ROLE_AND_SUBORDINATES = 'RS';
Method save
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save()
{
$ruleId = $this->getId();
$db = \App\Db::getInstance();
Class "Settings_SharingAccess_Rule_Model" has 21 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class Settings_SharingAccess_Rule_Model extends \App\Base
- 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.
Missing class import via use statement (line '409', column '18'). Open
$result = (new \App\Db\Query())->from('vtiger_datashare_module_rel')->where(['tabid' => $moduleModel->getId(), 'shareid' => $ruleId])->one();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '172', column '16'). Open
$row = (new App\Db\Query())->from($tableName)->where(['shareid' => $this->getId()])
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '427', column '22'). Open
$dataReader = (new App\Db\Query())->from('vtiger_datashare_module_rel')
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class 'Settings_SharingAccess_Module_Model' in method 'setModule'. Open
$module = Settings_SharingAccess_Module_Model::getInstance($moduleName);
- 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 'Settings_SharingAccess_RuleMember_Model' in method 'getRuleComponents'. Open
$qualifiedTargetId = Settings_SharingAccess_RuleMember_Model::getQualifiedId($targetMemberType, $row[$targetColumnName]);
- 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 'Settings_SharingAccess_RuleMember_Model' in method 'save'. Open
$sourceIdComponents = Settings_SharingAccess_RuleMember_Model::getIdComponentsFromQualifiedId($sourceId);
- 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 'Settings_SharingAccess_RuleMember_Model' in method 'getRuleComponents'. Open
$qualifiedSourceId = Settings_SharingAccess_RuleMember_Model::getQualifiedId($sourceMemberType, $row[$sourceColumnName]);
- 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 'Settings_SharingAccess_RuleMember_Model' in method 'getRuleComponents'. Open
$this->rule_details['source_member'] = Settings_SharingAccess_RuleMember_Model::getInstance($qualifiedSourceId);
- 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 'Settings_SharingAccess_Module_Model' in method 'save'. Open
Settings_SharingAccess_Module_Model::recalculateSharingRules();
- 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 'Settings_SharingAccess_Module_Model' in method 'delete'. Open
Settings_SharingAccess_Module_Model::recalculateSharingRules();
- 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 'Settings_SharingAccess_RuleMember_Model' in method 'getRuleComponents'. Open
$this->rule_details['target_member'] = Settings_SharingAccess_RuleMember_Model::getInstance($qualifiedTargetId);
- 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_Link_Model' in method 'getRecordLinks'. Open
$links[] = Vtiger_Link_Model::getInstanceFromValues($recordLink);
- 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\Db' in method 'save'. Open
$db = \App\Db::getInstance();
- 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 'Settings_SharingAccess_RuleMember_Model' in method 'save'. Open
$targetIdComponents = Settings_SharingAccess_RuleMember_Model::getIdComponentsFromQualifiedId($targetId);
- 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 save uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$relationTypeComponents = explode('::', $this->get('relationtype'));
$sourceType = $relationTypeComponents[0];
$targetType = $relationTypeComponents[1];
- 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
Define a constant instead of duplicating this literal "permission" 5 times. Open
$this->rule_details['permission'] = $row['permission'];
- 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 "share_roleid" 4 times. Open
'source_id' => 'share_roleid',
- 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 "target_id" 19 times. Open
'target_id' => 'to_groupid',
- 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 "index.php?parent=Settings&module=Roles&view=Edit&record=" 4 times. Open
return 'index.php?parent=Settings&module=Roles&view=Edit&record=' . $sourceMemberDetails[1];
- 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 "share_groupid" 4 times. Open
'source_id' => 'share_groupid',
- 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 "source_id" 19 times. Open
'source_id' => 'share_groupid',
- 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 "to_groupid" 4 times. Open
'target_id' => 'to_groupid',
- 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 "share_roleandsubid" 4 times. Open
'source_id' => 'share_roleandsubid',
- 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 "to_roleandsubid" 4 times. Open
'target_id' => 'to_roleandsubid',
- 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 "table" 20 times. Open
'table' => 'vtiger_datashare_grp2grp',
- 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 "share_userid" 4 times. Open
'source_id' => 'share_userid',
- 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 "tabid" 3 times. Open
'tabid' => $this->getModule()->getId(),
- 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 "to_userid" 4 times. Open
'target_id' => 'to_userid',
- 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 "to_roleid" 4 times. Open
'target_id' => 'to_roleid',
- 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 "vtiger_datashare_module_rel" 5 times. Open
$db->createCommand()->insert('vtiger_datashare_module_rel', [
- 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 "relationtype" 6 times. Open
$relationTypeComponents = explode('::', $this->get('relationtype'));
- 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 "shareid" 10 times. Open
return $this->get('shareid');
- 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 \Settings_SharingAccess_Rule_Model->module
(Did you mean $module) Open
$this->module = $module;
- Exclude checks
Argument 1 (qualifiedId)
is string
but \Settings_SharingAccess_RuleMember_Model::getInstance()
takes int
defined at /code/modules/Settings/SharingAccess/models/RuleMember.php:56
Open
$this->rule_details['target_member'] = Settings_SharingAccess_RuleMember_Model::getInstance($qualifiedTargetId);
- Exclude checks
Reference to undeclared property \Settings_SharingAccess_Rule_Model->rule_details
Open
$this->rule_details['permission'] = $row['permission'];
- Exclude checks
Reference to undeclared property \Settings_SharingAccess_Rule_Model->rule_details
Open
return $this->rule_details;
- Exclude checks
Call to method getId
on non-class type string
Open
return '?module=SharingAccess&parent=Settings&action=IndexAjax&mode=deleteRule&for_module=' . $this->getModule()->getId() . '&record=' . $this->getId();
- Exclude checks
Returning type string
but getTargetDetailViewUrl()
is declared to return \DetailViewUrl
Open
return 'index.php?parent=Settings&module=Groups&view=Detail&record=' . $targetMemberDetails[1];
- Exclude checks
Return type of getTargetMemberName()
is undeclared type \Name
Open
public function getTargetMemberName()
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$dataReader = (new App\Db\Query())->from('vtiger_datashare_module_rel')
- Exclude checks
Call to method getId
on non-class type string
Open
return '?module=SharingAccess&parent=Settings&view=IndexAjax&mode=editRule&for_module=' . $this->getModule()->getId() . '&record=' . $this->getId();
- Exclude checks
Returning type string
but getTargetDetailViewUrl()
is declared to return \DetailViewUrl
Open
return 'index.php?parent=Settings&module=Roles&view=Edit&record=' . $targetMemberDetails[1];
- Exclude checks
Returning type string
but getTargetMemberName()
is declared to return \Name
Open
return $targetMemberDetails[0];
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('vtiger_datashare_module_rel', [
- Exclude checks
Return type of getSourceMemberName()
is undeclared type \Name
Open
public function getSourceMemberName()
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->delete($tableColumnInfo['table'], ['shareid' => $ruleId])->execute();
- Exclude checks
Reference to undeclared property \Settings_SharingAccess_Rule_Model->rule_details
Open
$this->rule_details['target_member'] = Settings_SharingAccess_RuleMember_Model::getInstance($qualifiedTargetId);
- Exclude checks
Returning type string
but getSourceDetailViewUrl()
is declared to return \DetailViewUrl
Open
return 'index.php?parent=Settings&module=Roles&view=Edit&record=' . $sourceMemberDetails[1];
- Exclude checks
Returning type string
but getSourceMemberName()
is declared to return \Name
Open
return $sourceMemberDetails[0];
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->insert($tableName, [
- Exclude checks
Reference to undeclared property \Settings_SharingAccess_Rule_Model->rule_details
Open
if (!isset($this->rule_details) && $this->getId()) {
- Exclude checks
Reference to undeclared property \Settings_SharingAccess_Rule_Model->rule_details
Open
$this->rule_details['source_member'] = Settings_SharingAccess_RuleMember_Model::getInstance($qualifiedSourceId);
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$row = (new App\Db\Query())->from($tableName)->where(['shareid' => $this->getId()])
- Exclude checks
Returning type \Settings_SharingAccess_Rule_Model
but getInstance()
is declared to return array
Open
return $ruleModel->setData($result)->setModuleFromInstance($moduleModel);
- Exclude checks
Returning type false
but getInstance()
is declared to return array
Open
return false;
- Exclude checks
Argument 1 (qualifiedId)
is string
but \Settings_SharingAccess_RuleMember_Model::getInstance()
takes int
defined at /code/modules/Settings/SharingAccess/models/RuleMember.php:56
Open
$this->rule_details['source_member'] = Settings_SharingAccess_RuleMember_Model::getInstance($qualifiedSourceId);
- Exclude checks
Return type of getTargetDetailViewUrl()
is undeclared type \DetailViewUrl
Open
public function getTargetDetailViewUrl()
- Exclude checks
Returning type string
but getTargetDetailViewUrl()
is declared to return \DetailViewUrl
Open
return 'index.php?parent=Settings&module=Roles&view=Edit&record=' . $targetMemberDetails[1];
- Exclude checks
Saw unextractable annotation for comment '* @return <number> Id'</number>
Open
* @return <Number> Id
- Exclude checks
Reference to undeclared property \Settings_SharingAccess_Rule_Model->module
(Did you mean $module) Open
$this->module = $module;
- Exclude checks
Return type of getSourceDetailViewUrl()
is undeclared type \DetailViewUrl
Open
public function getSourceDetailViewUrl()
- Exclude checks
Call to method getId
on non-class type string
Open
'tabid' => $this->getModule()->getId(),
- Exclude checks
Reference to undeclared property \Settings_SharingAccess_Rule_Model->module
Open
return $this->module;
- Exclude checks
Returning type string
but getSourceDetailViewUrl()
is declared to return \DetailViewUrl
Open
return 'index.php?parent=Settings&module=Groups&view=Detail&record=' . $sourceMemberDetails[1];
- Exclude checks
Returning type string
but getSourceDetailViewUrl()
is declared to return \DetailViewUrl
Open
return 'index.php?parent=Settings&module=Roles&view=Edit&record=' . $sourceMemberDetails[1];
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->insert('vtiger_datashare_module_rel', [
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$dbCommand = App\Db::getInstance()->createCommand();
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$result = (new \App\Db\Query())->from('vtiger_datashare_module_rel')->where(['tabid' => $moduleModel->getId(), 'shareid' => $ruleId])->one();
- Exclude checks
Similar blocks of code found in 4 locations. Consider refactoring. Open
self::RULE_TYPE_GROUPS => [
self::RULE_TYPE_GROUPS => [
'table' => 'vtiger_datashare_grp2grp',
'source_id' => 'share_groupid',
'target_id' => 'to_groupid',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 105.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
self::RULE_TYPE_ROLE_AND_SUBORDINATES => [
self::RULE_TYPE_GROUPS => [
'table' => 'vtiger_datashare_rs2grp',
'source_id' => 'share_roleandsubid',
'target_id' => 'to_groupid',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 105.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
self::RULE_TYPE_USERS => [
self::RULE_TYPE_GROUPS => [
'table' => 'vtiger_datashare_us2grp',
'source_id' => 'share_userid',
'target_id' => 'to_groupid',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 105.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
self::RULE_TYPE_ROLE => [
self::RULE_TYPE_GROUPS => [
'table' => 'vtiger_datashare_role2group',
'source_id' => 'share_roleid',
'target_id' => 'to_groupid',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 105.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid excessively long variable names like $relationTypeComponents. Keep variable name length under 20. Open
$relationTypeComponents = explode('::', $this->get('relationtype'));
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $relationTypeComponents. Keep variable name length under 20. Open
$relationTypeComponents = explode('::', $this->get('relationtype'));
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $relationTypeComponents. Keep variable name length under 20. Open
$relationTypeComponents = explode('::', $this->get('relationtype'));
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $ruleMemberToRelationMapping. Keep variable name length under 20. Open
public static $ruleMemberToRelationMapping = [
self::RULE_TYPE_GROUPS => Settings_SharingAccess_RuleMember_Model::RULE_MEMBER_TYPE_GROUPS,
self::RULE_TYPE_ROLE => Settings_SharingAccess_RuleMember_Model::RULE_MEMBER_TYPE_ROLES,
self::RULE_TYPE_ROLE_AND_SUBORDINATES => Settings_SharingAccess_RuleMember_Model::RULE_MEMBER_TYPE_ROLE_AND_SUBORDINATES,
self::RULE_TYPE_USERS => Settings_SharingAccess_RuleMember_Model::RULE_MEMBER_TYPE_USERS,
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_SharingAccess_Rule_Model extends \App\Base
- Exclude checks
Avoid variables with short names like $db. Configured minimum length is 3. Open
$db = \App\Db::getInstance();
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The class Settings_SharingAccess_Rule_Model is not named in CamelCase. Open
class Settings_SharingAccess_Rule_Model extends \App\Base
{
const RULE_TYPE_GROUPS = 'GRP';
const RULE_TYPE_ROLE = 'ROLE';
const RULE_TYPE_ROLE_AND_SUBORDINATES = 'RS';
- 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
self::RULE_TYPE_ROLE_AND_SUBORDINATES => Settings_SharingAccess_RuleMember_Model::RULE_MEMBER_TYPE_ROLE_AND_SUBORDINATES,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => 'share_groupid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const READ_WRITE_PERMISSION = 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_GROUPS => Settings_SharingAccess_RuleMember_Model::RULE_MEMBER_TYPE_GROUPS,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static $allPermissions = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static $dataShareTableColArr = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_GROUPS => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_roleandsubid',
- 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
'table' => 'vtiger_datashare_role2rs',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_ROLE => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => 'share_roleandsubid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$module = Settings_SharingAccess_Module_Model::getInstance($moduleName);
- 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
public function setModuleFromInstance($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
return $this->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
const RULE_TYPE_USERS = 'US';
- 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 $ruleMemberToRelationMapping = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_ROLE => Settings_SharingAccess_RuleMember_Model::RULE_MEMBER_TYPE_ROLES,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_USERS => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => 'share_roleid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_ROLE_AND_SUBORDINATES => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_roleid',
- 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
Line exceeds 120 characters; contains 128 characters Open
$this->rule_details['source_member'] = Settings_SharingAccess_RuleMember_Model::getInstance($qualifiedSourceId);
- 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
self::READ_ONLY_PERMISSION => 'Read Only',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_groupid',
- 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
$row = (new App\Db\Query())->from($tableName)->where(['shareid' => $this->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
self::RULE_TYPE_USERS => Settings_SharingAccess_RuleMember_Model::RULE_MEMBER_TYPE_USERS,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_grp2grp',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_grp2rs',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_us2grp',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_ROLE_AND_SUBORDINATES => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_groupid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_USERS => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_roleandsubid',
- 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
* Function to get the Group Name.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($row) {
- Exclude checks
Line exceeds 120 characters; contains 137 characters Open
$qualifiedTargetId = Settings_SharingAccess_RuleMember_Model::getQualifiedId($targetMemberType, $row[$targetColumnName]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::READ_WRITE_PERMISSION => 'Read Write',
- 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
'table' => 'vtiger_datashare_grp2role',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_roleid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_USERS => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_role2us',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_userid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_rs2rs',
- 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
$targetType = $relationTypeComponents[1];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$qualifiedSourceId = Settings_SharingAccess_RuleMember_Model::getQualifiedId($sourceMemberType, $row[$sourceColumnName]);
- 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
const RULE_TYPE_ROLE = 'ROLE';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const RULE_TYPE_ROLE_AND_SUBORDINATES = 'RS';
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
self::RULE_TYPE_ROLE_AND_SUBORDINATES => Settings_SharingAccess_RuleMember_Model::RULE_MEMBER_TYPE_ROLE_AND_SUBORDINATES,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_groupid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_GROUPS => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_us2us',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_userid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_us2role',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_ROLE => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_roleid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->get('shareid');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Line exceeds 120 characters; contains 137 characters Open
$qualifiedSourceId = Settings_SharingAccess_RuleMember_Model::getQualifiedId($sourceMemberType, $row[$sourceColumnName]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->rule_details['target_member'] = Settings_SharingAccess_RuleMember_Model::getInstance($qualifiedTargetId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getId()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => 'share_userid',
- 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
'source_id' => 'share_roleid',
- 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 rules.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relationTypeComponents = explode('::', $this->get('relationtype'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$targetColumnName = $tableColumnInfo['target_id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->rule_details['source_member'] = Settings_SharingAccess_RuleMember_Model::getInstance($qualifiedSourceId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const RULE_TYPE_GROUPS = 'GRP';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const READ_ONLY_PERMISSION = 0;
- 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
self::RULE_TYPE_GROUPS => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_ROLE_AND_SUBORDINATES => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_USERS => [
- 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
self::RULE_TYPE_ROLE => [
- 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 setModule($moduleName)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->module = $module;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceColumnName = $tableColumnInfo['source_id'];
- 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
'source_id' => 'share_userid',
- 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
self::RULE_TYPE_USERS => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_rs2role',
- 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 Id of the Sharing Access Rule.
- 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
$qualifiedTargetId = Settings_SharingAccess_RuleMember_Model::getQualifiedId($targetMemberType, $row[$targetColumnName]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => 'share_groupid',
- 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
'source_id' => 'share_userid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_role2role',
- 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
protected function getRuleComponents()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableColumnInfo = self::$dataShareTableColArr[$sourceType][$targetType];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_ROLE => [
- 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
'table' => 'vtiger_datashare_us2rs',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_groupid',
- 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->module = $module;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->rule_details;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSourceMember()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => 'share_groupid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_GROUPS => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => 'share_roleid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_userid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return <Number> Id
- 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
$sourceType = $relationTypeComponents[0];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$targetMemberType = self::$ruleMemberToRelationMapping[$targetType];
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
$this->rule_details['target_member'] = Settings_SharingAccess_RuleMember_Model::getInstance($qualifiedTargetId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_grp2us',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_roleid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_roleandsubid',
- 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
$tableName = $tableColumnInfo['table'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceMemberType = self::$ruleMemberToRelationMapping[$sourceType];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => 'share_groupid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'target_id' => 'to_userid',
- 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
'target_id' => 'to_roleandsubid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_role2group',
- 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 getModule()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($this->rule_details) && $this->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
$ruleComponents = $this->getRuleComponents();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => 'share_userid',
- 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
'source_id' => 'share_roleid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_GROUPS => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_rs2us',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => 'share_roleandsubid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_ROLE_AND_SUBORDINATES => [
- 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
}
- 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 getDeleteActionUrl()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return DetailViewUrl
- 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
self::RULE_TYPE_ROLE => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::RULE_TYPE_ROLE_AND_SUBORDINATES => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_datashare_rs2grp',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => 'share_roleandsubid',
- 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
'source_id' => 'share_roleandsubid',
- 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->rule_details['permission'] = $row['permission'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $ruleComponents['source_member'];
- 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
$ruleComponents = $this->getRuleComponents();
- 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 isReadOnly()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getId()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::READ_ONLY_PERMISSION == $permission;
- 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 $targetMemberDetails[0];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'LBL_DELETE_RECORD',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($recordLinks as $recordLink) {
- 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
{
- 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
$permission = $this->getPermission();
- 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 'index.php?parent=Settings&module=Roles&view=Edit&record=' . $targetMemberDetails[1];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$targetMember = $this->getTargetMember()->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'LISTVIEWRECORD',
- 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
$tableColumnInfo = self::$dataShareTableColArr[$sourceType][$targetType];
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isReadWrite()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getId()) {
- Exclude checks
Line exceeds 120 characters; contains 160 characters Open
return '?module=SharingAccess&parent=Settings&action=IndexAjax&mode=deleteRule&for_module=' . $this->getModule()->getId() . '&record=' . $this->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceMemberDetails = explode(':', $sourceMember);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 'index.php?parent=Settings&module=Groups&view=Detail&record=' . $sourceMemberDetails[1];
- 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 save()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ruleId = $db->getLastInsertID('vtiger_datashare_module_rel_shareid_seq');
- 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 'index.php?parent=Settings&module=Roles&view=Edit&record=' . $sourceMemberDetails[1];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkurl' => 'javascript:app.showModalWindow(null, "' . $this->getEditViewUrl() . '");',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceId = $this->get('source_id');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getId()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$permission = $this->getPermission();
- 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 detailViewUrl for the rule member in Sharing Access Custom Rules.
- 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
$recordLinks = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkicon' => 'fas fa-trash-alt',
- 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
$relationTypeComponents = explode('::', $this->get('relationtype'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceType = array_search($sourceIdComponents[0], self::$ruleMemberToRelationMapping);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$targetId = $this->get('target_id');
- Exclude checks
Line exceeds 120 characters; contains 156 characters Open
return '?module=SharingAccess&parent=Settings&view=IndexAjax&mode=editRule&for_module=' . $this->getModule()->getId() . '&record=' . $this->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return DetailViewUrl
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Groups' == $targetMemberDetails[0]) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Name of the rule Member
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$links = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db = \App\Db::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->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
public function getPermission()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getTargetDetailViewUrl()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$targetMemberDetails = explode(':', $targetMember);
- 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
'tabid' => $this->getModule()->getId(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->set('shareid', $ruleId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$targetType = array_search($targetIdComponents[0], self::$ruleMemberToRelationMapping);
- 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 'index.php?parent=Settings&module=Groups&view=Detail&record=' . $targetMemberDetails[1];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ruleId = $this->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$ruleId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'permission' => $this->get('permission'),
- 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 detailViewUrl for the rule member in Sharing Access Custom Rules.
- 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 ('Roles' === $sourceMemberDetails[0]) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('RoleAndSubordinates' === $sourceMemberDetails[0]) {
- 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 Member Name from the Rule Model.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Name of the rule Member
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getTargetMemberName()
- 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 $links;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceIdComponents = Settings_SharingAccess_RuleMember_Model::getIdComponentsFromQualifiedId($sourceId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->insert($tableName, [
- 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 $ruleComponents['target_member'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getEditViewUrl()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSourceDetailViewUrl()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return '?module=SharingAccess&parent=Settings&view=IndexAjax&mode=editRule&for_module=' . $this->getModule()->getId() . '&record=' . $this->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
$sourceMember = $this->getSourceMember()->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 'index.php?parent=Settings&module=Roles&view=Edit&record=' . $sourceMemberDetails[1];
- 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
$targetMember = $this->getTargetMember()->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $sourceMemberDetails[0];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 'index.php?parent=Settings&module=Roles&view=Edit&record=' . $targetMemberDetails[1];
- 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
'linkicon' => 'yfi yfi-full-editing-view',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->delete($tableColumnInfo['table'], ['shareid' => $ruleId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$targetIdComponents = Settings_SharingAccess_RuleMember_Model::getIdComponentsFromQualifiedId($targetId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->insert('vtiger_datashare_module_rel', [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableColumnName = self::$dataShareTableColArr[$sourceType][$targetType];
- 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
* Delete the rule.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['tabid' => $moduleModel->getId()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Settings_SharingAccess_Module_Model::recalculateSharingRules();
- 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
$ruleModels[$row['shareid']] = $ruleModel->setData($row)->setModuleFromInstance($moduleModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 149 characters Open
$result = (new \App\Db\Query())->from('vtiger_datashare_module_rel')->where(['tabid' => $moduleModel->getId(), 'shareid' => $ruleId])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($result) {
- 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 self::READ_WRITE_PERMISSION == $permission;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return '?module=SharingAccess&parent=Settings&action=IndexAjax&mode=deleteRule&for_module=' . $this->getModule()->getId() . '&record=' . $this->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('RoleAndSubordinates' == $targetMemberDetails[0]) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSourceMemberName()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceMemberDetails = explode(':', $sourceMember);
- 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
$targetType = $relationTypeComponents[1];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->update('vtiger_datashare_module_rel', [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function delete()
- 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 mixed $moduleModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ruleModels = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $ruleModels;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'relationtype' => $this->get('relationtype'),
- 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
$dbCommand->delete('vtiger_datashare_module_rel', ['shareid' => $ruleId])->execute();
- 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
->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ruleModel = new self();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getTargetMember()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ruleComponents = $this->getRuleComponents();
- 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 ('Groups' === $sourceMemberDetails[0]) {
- 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 getRecordLinks(): array
- 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
'linklabel' => 'LBL_EDIT_RECORD',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'LISTVIEWRECORD',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$targetColumnName = $tableColumnName['target_id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relationTypeComponents = explode('::', $this->get('relationtype'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Settings_SharingAccess_Module_Model::recalculateSharingRules();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ruleModel = new self();
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new App\Db\Query())->from('vtiger_datashare_module_rel')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstance($moduleModel, $ruleId)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $ruleId
- 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
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $moduleModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array - Array of Settings_Groups_Record_Model instances
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $ruleModel->setData($result)->setModuleFromInstance($moduleModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Settings_Groups_Record_Model[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ruleId = $this->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getAllByModule($moduleModel)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $ruleComponents['permission'];
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Roles' == $targetMemberDetails[0]) {
- 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
$sourceMember = $this->getSourceMember()->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the Member Name from the Rule 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
$targetMemberDetails = explode(':', $targetMember);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkurl' => 'javascript:app.showModalWindow(null, "' . $this->getDeleteActionUrl() . '");',
- 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
$links[] = Vtiger_Link_Model::getInstanceFromValues($recordLink);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceType = $relationTypeComponents[0];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceColumnName = $tableColumnName['source_id'];
- 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
'shareid' => $ruleId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
], ['shareid' => $ruleId])->execute();
- 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
$tableName = $tableColumnName['table'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand = App\Db::getInstance()->createCommand();
- 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->set('relationtype', implode('::', [$sourceType, $targetType]));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$targetColumnName => $targetIdComponents[1],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableColumnInfo = self::$dataShareTableColArr[$relationTypeComponents[0]][$relationTypeComponents[1]];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->delete($tableColumnInfo['table'], ['shareid' => $ruleId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get all the rules.
- 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
$sourceColumnName => $sourceIdComponents[1],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get all the rules.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result = (new \App\Db\Query())->from('vtiger_datashare_module_rel')->where(['tabid' => $moduleModel->getId(), 'shareid' => $ruleId])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Class name "Settings_SharingAccess_Rule_Model" is not in camel caps format Open
class Settings_SharingAccess_Rule_Model extends \App\Base
- Exclude checks