* fix for return fields.
This commit is contained in:
@@ -20,7 +20,7 @@ class executionsEntry extends entry
|
||||
*/
|
||||
public function get($projectID = 0)
|
||||
{
|
||||
$returnFields = explode(',', $this->param('return', ''));
|
||||
$returnFields = $this->param('return', '');
|
||||
|
||||
$control = $this->loadController('execution', 'all');
|
||||
$control->all($this->param('status', 'all'), $this->param('project', $projectID), $this->param('order', 'id_desc'), 0, 0, $this->param('limit', 20), $this->param('page', 1));
|
||||
|
||||
@@ -21,7 +21,7 @@ class projectsEntry extends entry
|
||||
public function get($programID = 0)
|
||||
{
|
||||
if(!$programID) $programID = $this->param('program', 0);
|
||||
$returnFields = explode(',', $this->param('return', ''));
|
||||
$returnFields = $this->param('return', '');
|
||||
|
||||
$control = $this->loadController('project', 'browse');
|
||||
$control->browse($programID, $this->param('status', 'all'), 0, $this->param('order', 'order_asc'), 0, $this->param('limit', 20), $this->param('page', 1));
|
||||
|
||||
@@ -532,10 +532,12 @@ class baseEntry
|
||||
public function filterFields($object, $allowable = '')
|
||||
{
|
||||
if(empty($allowable)) return $object;
|
||||
if(is_string($allowable)) $allowable = explode(',', $allowable);
|
||||
|
||||
$filtered = new stdclass();
|
||||
foreach($allowable as $field)
|
||||
{
|
||||
$field = trim($field);
|
||||
if(!isset($object->$field)) continue;
|
||||
$filtered->$field = $object->$field;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user