[quote="ajb":22f5r6um]
Proszę zajrzeć do pliku modules/CRM/Contacts/ContactsCommon_0.php i wyszukać metodę statyczną search. Powinno to trochę rozjaśnić sytuację. Należy tam dodać nowe kryterium.
[/quote:22f5r6um]
public static function search($word){
$ret = array();
if(Utils_RecordBrowserCommon::get_access('contact','browse')) {
$wo = explode(' ', $word);
$crits = array();
foreach ($wo as $w)
$crits = Utils_RecordBrowserCommon::merge_crits($crits, array('("~first_name'=>DB::Concat(DB::qstr('%'),DB::qstr($w),DB::qstr('%')), '|"~last_name'=>DB::Concat(DB::qstr('%'),DB::qstr($w),DB::qstr('%'))));
$result = self::get_contacts($crits);
foreach ($result as $row)
$ret[$row['id']] = Utils_RecordBrowserCommon::record_link_open_tag('contact', $row['id']).__( 'Contact #%d, %s %s', array($row['id'], $row['first_name'], $row['last_name'])).Utils_RecordBrowserCommon::record_link_close_tag();
}
if(Utils_RecordBrowserCommon::get_access('company','browse')) {
$result = self::get_companies(array('"~company_name'=>DB::Concat('\'%\'',DB::qstr($word),'\'%\'')));
foreach ($result as $row)
$ret[$row['id']] = Utils_RecordBrowserCommon::record_link_open_tag('company', $row['id']).__( 'Company #%d, %s', array($row['id'], $row['company_name'])).Utils_RecordBrowserCommon::record_link_close_tag();
$result = self::get_companies(array('"~short_name'=>DB::Concat('\'%\'',DB::qstr($word),'\'%\'')));
foreach ($result as $row)
$ret[$row['id']] = Utils_RecordBrowserCommon::record_link_open_tag('company', $row['id']).__( 'Company #%d, %s', array($row['id'], $row['company_name'])).Utils_RecordBrowserCommon::record_link_close_tag();
}
return $ret;
}
Czy chodzi o tą funkcje ?
Pozdrawiam,
Daniel