public function onFilter($sender) { $search = $sender->search->getText(); if (strlen($search) > 0) { $this->_ds->setWhere('lastname like ' . Contact::qstr("%{$search}%")); } else { $this->_ds->setWhere(); } $this->contacttable->contactlist->Reload(); }
public function OnDetail($saved = false, $id = 0) { $contact = Contact::load($this->contactdetail->getItem()->contact_id); $this->employeedetail->editcontact->setText($contact->fullname); $this->employeedetail->editcontact->setKey($contact->contact_id); $this->contactdetail->setVisible(false); $this->employeedetail->setVisible(true); if ($saved) { //обновляем данные сотрудника из контакта $this->employeetable->employeelist->Reload(); $this->employeedetail->opencontact->setVisible(true); $this->employeedetail->showcontact->setVisible(true); $this->employeedetail->addcontact->setVisible(false); } }
public function onAutoCompleteContact($sender) { $text = $sender->getValue(); return Contact::findArray("fullname", " employee = 0 and customer = 0 and fullname like '%{$text}%' ", "fullname", null, 20); }