AnsweredAssumed Answered

What is the best way to hide/show favorite button conditionally in documents

Question asked by Sundar Kumar on Mar 6, 2018

I want to hide and show Favorite button conditionally in documents list view page. Looks like the code is written in the SugarFavorites.php in the following path : (/modules/SugarFavorites/SugarFavorites.php) in the below code. 

 

public static function generateStar(
    $on,
    $module,
    $record
    )
{
           return '<div class="star" ><div class="'. ($on ? 'on': 'off') .'" onclick="var self=this; parent.SUGAR.App.api.favorite(\''.$module. '\'\''.$record. '\', $(self).hasClass(\'off\'), { success: function() {$(self).toggleClass(\'on off\');} });"> </div></div>';

       }

I am using SugarULT 7.9.1.0 and document is BWC module. Can we extend this file?

 

Any suggestions on an approach? Has anyone else done this?

 

Thanks in advance.

 

Regards,

Sundar

Outcomes