* code for task #2522,2579.

This commit is contained in:
wangyidong
2016-04-20 14:51:05 +08:00
parent 164f7630d3
commit d89d674cdd
29 changed files with 385 additions and 173 deletions
+36
View File
@@ -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;
}
}
}