* Adjust the GetList method of the program module.
This commit is contained in:
@@ -421,7 +421,7 @@ class my extends control
|
||||
|
||||
$this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->myProgram;
|
||||
$this->view->position[] = $this->lang->my->myProgram;
|
||||
$this->view->programs = $this->program->getList($status, $orderBy, $pager, true);
|
||||
$this->view->programs = $this->program->getList($status, $orderBy, $pager, true, true);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->pager = $pager;
|
||||
$this->view->status = $status;
|
||||
|
||||
@@ -8,10 +8,11 @@ class programModel extends model
|
||||
* @param varchar $orderBy
|
||||
* @param object $pager
|
||||
* @param bool $includeCat
|
||||
* @param bool $mine
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($status = 'all', $orderBy = 'id_desc', $pager = NULL, $includeCat = false)
|
||||
public function getList($status = 'all', $orderBy = 'id_desc', $pager = NULL, $includeCat = false, $mine = false)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_PROJECT)
|
||||
->where('program')->eq(0)
|
||||
@@ -20,7 +21,7 @@ class programModel extends model
|
||||
->beginIF(!$includeCat)->andWhere('iscat')->eq(0)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi()
|
||||
->beginIF($status != 'all')->andWhere('status')->eq($status)->fi()
|
||||
->beginIF($this->cookie->mine)
|
||||
->beginIF($this->cookie->mine or $mine)
|
||||
->andWhere('openedBy', true)->eq($this->app->user->account)
|
||||
->orWhere('PM')->eq($this->app->user->account)
|
||||
->markRight(1)
|
||||
|
||||
Reference in New Issue
Block a user