YetiForceCompany/YetiForceCRM

View on GitHub
modules/Competition/models/DetailView.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

/**
 * Competition detail view model class.
 *
 * @copyright YetiForce S.A.
 * @license YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
 * @author Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>
 */
class Competition_DetailView_Model extends Vtiger_DetailView_Model
{
    /** {@inheritdoc} */
    public function getDetailViewRelatedLinks()
    {
        $relatedLinks = parent::getDetailViewRelatedLinks();
        $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
        if ($userPrivilegesModel->hasModulePermission('OpenStreetMap')) {
            $relatedLinks[] = [
                'linktype' => 'DETAILVIEWTAB',
                'linklabel' => 'LBL_MAP',
                'linkurl' => $this->getRecord()->getDetailViewUrl() . '&mode=showOpenStreetMap',
                'linkicon' => '',
            ];
        }
        return $relatedLinks;
    }
}