* refactor.
This commit is contained in:
@@ -46,7 +46,7 @@ class program extends control
|
||||
$whitelist = '';
|
||||
$acl = 'open';
|
||||
if($copyProgramID)
|
||||
{
|
||||
{
|
||||
$copyProgram = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($copyProgramID)->fetch();
|
||||
$name = $copyProgram->name;
|
||||
$code = $copyProgram->code;
|
||||
@@ -79,7 +79,7 @@ class program extends control
|
||||
$changes = $this->project->update($projectID);
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError())));
|
||||
if($changes)
|
||||
{
|
||||
{
|
||||
$actionID = $this->loadModel('action')->create('project', $projectID, 'edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ class programModel extends model
|
||||
$lib->product = $productID;
|
||||
$lib->name = $this->lang->doclib->main['product'];
|
||||
$lib->type = 'product';
|
||||
$lib->main = '1';
|
||||
$lib->main = '1';
|
||||
$lib->acl = 'default';
|
||||
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
|
||||
|
||||
@@ -114,6 +114,6 @@ class programModel extends model
|
||||
|
||||
public function getProducts($program)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_PRODUCT)->where('project')->eq($program)->fetchAll('id');
|
||||
return $this->dao->select('*')->from(TABLE_PRODUCT)->where('project')->eq($program)->fetchAll('id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1121,9 +1121,9 @@ class projectModel extends model
|
||||
|
||||
/**
|
||||
* Get ordered projects.
|
||||
*
|
||||
* @param string $status
|
||||
* @param int $num
|
||||
*
|
||||
* @param string $status
|
||||
* @param int $num
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -2051,7 +2051,7 @@ class projectModel extends model
|
||||
->andWhere('t1.id')->in(array_keys($taskIdList))
|
||||
->orderBy($orderBy)
|
||||
->fetchAll('id');
|
||||
|
||||
|
||||
if(empty($tasks)) return array();
|
||||
|
||||
$taskTeam = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->in(array_keys($tasks))->andWhere('type')->eq('task')->fetchGroup('root');
|
||||
@@ -2066,10 +2066,10 @@ class projectModel extends model
|
||||
if($task->parent > 0) $parents[$task->parent] = $task->parent;
|
||||
}
|
||||
$parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id');
|
||||
|
||||
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if($task->parent > 0)
|
||||
if($task->parent > 0)
|
||||
{
|
||||
if(isset($tasks[$task->parent]))
|
||||
{
|
||||
@@ -3000,8 +3000,8 @@ class projectModel extends model
|
||||
|
||||
/**
|
||||
* Update user view of project and it's product.
|
||||
*
|
||||
* @param int $projectID
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user