diff --git a/module/story/model.php b/module/story/model.php index b6c9d5c6e1..2d33a8c2ba 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -86,11 +86,11 @@ class storyModel extends model $story->children = array(); if($story->parent == '-1') $story->children = $this->dao->select('*')->from(TABLE_STORY)->where('parent')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll('id'); - $story->openedDate = substr($story->openedDate, 0, 19); - $story->assignedDate = substr($story->assignedDate, 0, 19); - $story->reviewedDate = substr($story->reviewedDate, 0, 19); - $story->closedDate = substr($story->closedDate, 0, 19); - $story->lastEditedDate= substr($story->lastEditedDate, 0, 19); + if($story->openedDate) $story->openedDate = substr($story->openedDate, 0, 19); + if($story->assignedDate) $story->assignedDate = substr($story->assignedDate, 0, 19); + if($story->reviewedDate) $story->reviewedDate = substr($story->reviewedDate, 0, 19); + if($story->closedDate) $story->closedDate = substr($story->closedDate, 0, 19); + if($story->lastEditedDate) $story->lastEditedDate= substr($story->lastEditedDate, 0, 19); return $story; } diff --git a/module/task/model.php b/module/task/model.php index 75fb9d6741..538713f28c 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -2409,12 +2409,12 @@ class taskModel extends model ->andWhere('t1.vision')->eq($this->config->vision) ->fetch(); if(!$task) return false; - $task->openedDate = substr($task->openedDate, 0, 19); - $task->finishedDate = substr($task->finishedDate, 0, 19); - $task->canceledDate = substr($task->canceledDate, 0, 19); - $task->closedDate = substr($task->closedDate, 0, 19); - $task->lastEditedDate = substr($task->lastEditedDate, 0, 19); - $task->realStarted = substr($task->realStarted, 0, 19); + if($task->openedDate) $task->openedDate = substr($task->openedDate, 0, 19); + if($task->finishedDate) $task->finishedDate = substr($task->finishedDate, 0, 19); + if($task->canceledDate) $task->canceledDate = substr($task->canceledDate, 0, 19); + if($task->closedDate) $task->closedDate = substr($task->closedDate, 0, 19); + if($task->lastEditedDate) $task->lastEditedDate = substr($task->lastEditedDate, 0, 19); + if($task->realStarted) $task->realStarted = substr($task->realStarted, 0, 19); $children = $this->dao->select('*')->from(TABLE_TASK)->where('parent')->eq($taskID)->andWhere('deleted')->eq(0)->fetchAll('id'); $task->children = $children; diff --git a/module/testcase/model.php b/module/testcase/model.php index 16f352a4b4..67a5fe8560 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -463,7 +463,7 @@ class testcaseModel extends model { $case = $this->dao->findById($caseID)->from(TABLE_CASE)->fetch(); if(!$case) return false; - foreach($case as $key => $value) if(strpos($key, 'Date') !== false and !(int)substr($value, 0, 4)) $case->$key = ''; + foreach($case as $key => $value) if(strpos($key, 'Date') !== false and helper::isZeroDate($value)) $case->$key = ''; /* Get project and execution. */ if($this->app->tab == 'project') diff --git a/module/user/model.php b/module/user/model.php index a59c30fd2f..c3d9efc59e 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -2712,7 +2712,10 @@ class userModel extends model $users = array(); foreach(explode(',', trim($this->app->company->admins, ',')) as $admin) $users[$admin] = $admin; - foreach(explode(',', trim($product->reviewer, ',')) as $account) $users[$account] = $account; + if(!empty($product->reviewer)) + { + foreach(explode(',', trim($product->reviewer, ',')) as $account) $users[$account] = $account; + } if(isset($product->PMT)) { foreach(explode(',', trim($product->PMT, ',')) as $account) $users[$account] = $account;