* Adjust code.

This commit is contained in:
leiyong
2020-12-25 16:47:36 +08:00
parent d7b50873a0
commit 402170d326
3 changed files with 8 additions and 9 deletions
+4 -3
View File
@@ -641,19 +641,20 @@ class program extends control
* @access public
* @return void
*/
public function ajaxGetCopyProjects($name = '', $copyProjectID = 0)
public function ajaxGetCopyProjects()
{
$data = fixer::input('post')->get();
$projects = $this->dao->select('id, name')->from(TABLE_PROJECT)
->where('type')->eq('project')
->andWhere('deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->beginIF($name)->andWhere('name')->like("%$name%")->fi()
->beginIF(trim($data->name))->andWhere('name')->like("%$data->name%")->fi()
->fetchPairs();
$html = empty($projects) ? "<div class='text-center'>{$this->lang->noData}</div>" : '';
foreach($projects as $id => $name)
{
$active = $copyProjectID == $id ? 'active' : '';
$active = $data->cpoyProjectID == $id ? 'active' : '';
$html .= "<div class='col-md-4 col-sm-6'><a href='javascript:;' data-id=$id class='nobr $active'>" . html::icon($this->lang->icons['project'], 'text-muted') . $name . "</a></div>";
}
echo $html;