YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php
/**
 * Partners detail view model file.
 *
 * @package   Model
 *
 * @copyright YetiForce S.A.
 * @license   YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
 */

/**
 * Partners detail view model class.
 */
class Partners_DetailView_Model extends Vtiger_DetailView_Model
{
    /** {@inheritdoc} */
    public function getDetailViewRelatedLinks()
    {
        $relatedLinks = parent::getDetailViewRelatedLinks();
        if (Users_Privileges_Model::getCurrentUserPrivilegesModel()->hasModulePermission('OpenStreetMap')) {
            $relatedLinks[] = [
                'linktype' => 'DETAILVIEWTAB',
                'linklabel' => 'LBL_MAP',
                'linkurl' => $this->getRecord()->getDetailViewUrl() . '&mode=showOpenStreetMap',
                'linkicon' => '',
            ];
        }
        return $relatedLinks;
    }
}