Merge branch 'master' of git@github.com:easysoft/zentaopms

This commit is contained in:
wyd621
2013-07-30 09:29:24 +08:00
3 changed files with 6 additions and 2 deletions
+2
View File
@@ -325,11 +325,13 @@ class productModel extends model
*/
public function getProjectPairs($productID, $param = 'all')
{
$projectList = array_keys($this->loadModel('project')->getPairs());
$projects = array();
$datas = $this->dao->select('t2.id, t2.name, t2.deleted')
->from(TABLE_PROJECTPRODUCT)->alias('t1')->leftJoin(TABLE_PROJECT)->alias('t2')
->on('t1.project = t2.id')
->where('t1.product')->eq((int)$productID)
->andWhere('t2.id')->in($projectList)
->orderBy('t1.project desc')
->fetchAll();
+1 -1
View File
@@ -37,7 +37,7 @@ class productplanModel extends model
* @access public
* @return object
*/
public function getList($product = 0, $pager = null, $orderBy)
public function getList($product = 0, $pager = null, $orderBy = 'begin_desc')
{
return $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('product')->eq($product)
->andWhere('deleted')->eq(0)
+3 -1
View File
@@ -648,8 +648,10 @@ class storyModel extends model
$story->lastEditedBy = $this->app->user->account;
$story->lastEditedDate = $now;
$story->plan = $planID;
if($planID) $story->stage = 'planned';
$this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq((int)$storyID)->exec();
if(!$planID) $this->setStage($storyID);
if(!dao::isError()) $allChanges[$storyID] = common::createChanges($oldStory, $story);
}
return $allChanges;
@@ -737,7 +739,7 @@ class storyModel extends model
/* If no projects, in plan, stage is planned. No plan, wait. */
if(!$projects)
{
$this->dao->update(TABLE_STORY)->set('stage')->eq('wait')->where('id')->eq((int)$storyID)->andWhere('plan')->eq(0)->andWhere('status')->eq('active')->exec();
$this->dao->update(TABLE_STORY)->set('stage')->eq('wait')->where('id')->eq((int)$storyID)->andWhere('plan')->eq(0)->exec();
$this->dao->update(TABLE_STORY)->set('stage')->eq('planned')->where('id')->eq((int)$storyID)->andWhere('plan')->gt(0)->exec();
return true;
}