Merge branch 'sprint/scx_getproductsbyproject' into 'master'
* Get products by projectID. See merge request easycorp/zentaopms!2541
This commit is contained in:
@@ -24,6 +24,7 @@ class productsEntry extends entry
|
||||
if(strpos(strtolower(",{$fields},"), ',dropmenu,') !== false) return $this->getDropMenu();
|
||||
|
||||
if(!$programID) $programID = $this->param('program', 0);
|
||||
if(!$projectID) $projectID = $this->param('project', 0);
|
||||
$mergeChildren = $this->param('mergeChildren', '');
|
||||
|
||||
if($programID)
|
||||
@@ -39,6 +40,18 @@ class productsEntry extends entry
|
||||
$products = $data->data->products;
|
||||
|
||||
}
|
||||
elseif($projectID)
|
||||
{
|
||||
$control = $this->loadController('project', 'manageProducts');
|
||||
$control->manageProducts($projectID);
|
||||
|
||||
/* Response */
|
||||
$data = $this->getData();
|
||||
if(!$data or !isset($data->status)) return $this->sendError(400, 'error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$products = $data->data->linkedProducts;
|
||||
}
|
||||
else
|
||||
{
|
||||
$control = $this->loadController('product', 'all');
|
||||
|
||||
Reference in New Issue
Block a user