How to hide "Updates" section in the records

How to hide "Updates" section in the records

Some administrators are wondering how to remove the History tab from the contact / account / transaction card, etc. Often in this tab there is unnecessary information that stores the entire history of the object and it does not need to be shown to all users. Therefore, for security reasons, it is advisable to disable this tab or leave only to the administrator.

To do this, you need to go through the following steps:

1. Open file modules/Vtiger/models/DetailView.php.

2. Find function public function getDetailViewRelatedLinks() {

3. Add this line global $current_user;

4. Find block 

if($parentModuleModel->isTrackingEnabled()) {

$relatedLinks[] = array(

'linktype' => 'DETAILVIEWTAB',

'linklabel' => 'LBL_UPDATES',

'linkurl' => $recordModel->getDetailViewUrl().'&mode=showRecentActivities&page=1',

'linkicon' => ''

);

 

}

And change it to

if($current_user->id == '2') {

$relatedLinks[] = array(

'linktype' => 'DETAILVIEWTAB',

'linklabel' => 'LBL_UPDATES',

'linkurl' => $recordModel->getDetailViewUrl().'&mode=showRecentActivities&page=1',

'linkicon' => ''

);

}

 

So our full function

public function getDetailViewRelatedLinks() {

    global $current_user;

$recordModel = $this->getRecord();

$moduleName = $recordModel->getModuleName();

$parentModuleModel = $this->getModule();

$relatedLinks = array();

 

if($parentModuleModel->isSummaryViewSupported()) {

$relatedLinks = array(array(

'linktype' => 'DETAILVIEWTAB',

'linklabel' => vtranslate('LBL_SUMMARY', $moduleName),

'linkKey' => 'LBL_RECORD_SUMMARY',

'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showDetailViewByMode&requestMode=summary',

'linkicon' => ''

));

}

//link which shows the summary information(generally detail of record)

$relatedLinks[] = array(

'linktype' => 'DETAILVIEWTAB',

'linklabel' => vtranslate('LBL_DETAILS', $moduleName),

'linkKey' => 'LBL_RECORD_DETAILS',

'linkurl' => $recordModel->getDetailViewUrl().'&mode=showDetailViewByMode&requestMode=full',

'linkicon' => ''

);

 

if($current_user->id == '2') {

$relatedLinks[] = array(

'linktype' => 'DETAILVIEWTAB',

'linklabel' => 'LBL_UPDATES',

'linkurl' => $recordModel->getDetailViewUrl().'&mode=showRecentActivities&page=1',

'linkicon' => ''

);

}

 

 

$relationModels = $parentModuleModel->getRelations();

 

foreach($relationModels as $relation) {

//TODO : Way to get limited information than getting all the information

$link = array(

'linktype' => 'DETAILVIEWRELATED',

'linklabel' => $relation->get('label'),

'linkurl' => $relation->getListUrl($recordModel),

'linkicon' => '',

'relatedModuleName' => $relation->get('relatedModuleName'),

'linkid' => $relation->getId()

);

$relatedLinks[] = $link;

}

 

return $relatedLinks;

}

 

Popular Posts

My most popular posts

Maximum productivity on remote job
Business

Maximum productivity on remote job

I started my own business and intentionally did my best to work from anywhere in the world. Sometimes I sit with my office with a large 27-inch monitor in my apartment in Cheboksary. Sometimes I’m in the office or in some cafe in another city.

Hello! I am Sergey Emelyanov and I am hardworker
Business PHP

Hello! I am Sergey Emelyanov and I am hardworker

I am a programmer. I am an entrepreneur in my heart. I started making money from the age of 11, in the harsh 90s, handing over glassware to a local store and exchanging it for sweets. I earned so much that was enough for various snacks.

Hire Professional CRM developer for $25 per hour

I will make time for your project. Knowledge of Vtiger CRM, SuiteCRM, Laravel, and Vue.js. I offer cooperation options that will help you take advantage of external experience, optimize costs and reduce risks. Full transparency of all stages of work and accounting for time costs. Pay only development working hours after accepting the task. Accept PayPal and Payoneer payment systems. How to hire professional developer? Just fill in the form

Telegram
@sergeyem
Telephone
+4915211100235