×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: tomas_pasicnyk
Added: Jan 9, 2017 10:09 AM
Views: 4
Tags: no tags
  1.  $datagrid->addColumn("Partner", array(), false)->addValue(function($object)
  2.         {
  3.             if($object->lead_type == "partner")
  4.             {
  5.                 return '------------';
  6.             }
  7.  
  8.             $partner_type = $object->getPartnerType() != '' ? ' ('.$object->getPartnerType().')' : '';
  9.             if($object->getPartnerType() == "INTERNAL")
  10.             {
  11.                 $html = new \Nette\Utils\Html();
  12.                 $html->setHtml('<span style="color: #ff7878;">' . $object->getPartner()->name . $partner_type . '</span>');
  13.                 return $html;
  14.             }
  15.             return $object->getPartner() ? $object->getPartner()->name . $partner_type : '';
  16.         });