* code for task #2522,2579.
This commit is contained in:
@@ -292,6 +292,23 @@ class searchModel extends model
|
||||
return $queries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shorcut query pairs.
|
||||
*
|
||||
* @param string $module
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getShorcutQueryPairs($module)
|
||||
{
|
||||
return $this->dao->select('id, title')->from(TABLE_USERQUERY)
|
||||
->where('account')->eq($this->app->user->account)
|
||||
->andWhere('module')->eq($module)
|
||||
->andWhere('shortcut')->eq(1)
|
||||
->orderBy('id_asc')
|
||||
->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get records by the conditon.
|
||||
*
|
||||
@@ -390,4 +407,23 @@ class searchModel extends model
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge shortcut query in featureBar.
|
||||
*
|
||||
* @param string $module
|
||||
* @param string $method
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function mergeFeatureBar($module, $method)
|
||||
{
|
||||
$queryModule = $module == 'project' ? 'task' : ($module == 'product' ? 'story' : $module);
|
||||
$shortcuts = $this->getShorcutQueryPairs($queryModule);
|
||||
foreach($shortcuts as $id => $name)
|
||||
{
|
||||
$shortcutID = 'QUERY' . $id;
|
||||
$this->lang->$module->featurebar[$method][$shortcutID] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user