More use of list_active(), setup ajax actions that are check to be ajax
This commit is contained in:
@@ -143,6 +143,36 @@ class Model_Service extends ORMOSB {
|
||||
|
||||
/** LIST FUNCTIONS **/
|
||||
|
||||
/**
|
||||
* Search for services matching a term
|
||||
*/
|
||||
public function list_autocomplete($term,$index='id',array $limit=array()) {
|
||||
$return = array();
|
||||
|
||||
$this->clear();
|
||||
$this->where_active();
|
||||
$value = 'service_name()';
|
||||
|
||||
// Build our where clause
|
||||
$this->where_open()
|
||||
->where('id','like','%'.$term.'%')
|
||||
->where_close();
|
||||
|
||||
foreach ($limit as $w) {
|
||||
list($k,$s,$v) = $w;
|
||||
|
||||
$this->and_where($k,$s,$v);
|
||||
}
|
||||
|
||||
foreach ($this->find_all() as $o)
|
||||
$return[$o->$index] = array(
|
||||
'value'=>$o->$index,
|
||||
'label'=>sprintf('SVC %s: %s',$o->id,Table::resolve($o,$value)),
|
||||
);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function list_bylistgroup($cat) {
|
||||
$result = array();
|
||||
|
||||
|
Reference in New Issue
Block a user