Merge branch 'sprint/scx_recordestimate' into 'master'
* Modify taskrecordestimate api. See merge request easycorp/zentaopms!3735
This commit is contained in:
@@ -20,7 +20,8 @@ class taskRecordEstimateEntry extends Entry
|
||||
*/
|
||||
public function get($taskID)
|
||||
{
|
||||
if($this->config->edition != 'open')
|
||||
$issetEffort = $this->loadModel('effort') ? true : false;
|
||||
if($issetEffort)
|
||||
{
|
||||
$control = $this->loadController('effort', 'createForObject');
|
||||
$control->createForObject('task', $taskID);
|
||||
@@ -36,8 +37,8 @@ class taskRecordEstimateEntry extends Entry
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$effort = array();
|
||||
if($this->config->edition != 'open' and $data->data->efforts) $effort = $data->data->efforts;
|
||||
if($this->config->edition == 'open' and $data->data->estimates) $effort = $data->data->estimates;
|
||||
if($issetEffort and $data->data->efforts) $effort = $data->data->efforts;
|
||||
if(!$issetEffort and $data->data->estimates) $effort = $data->data->estimates;
|
||||
$this->send(200, array('effort' => $effort));
|
||||
|
||||
}
|
||||
@@ -51,7 +52,7 @@ class taskRecordEstimateEntry extends Entry
|
||||
*/
|
||||
public function post($taskID)
|
||||
{
|
||||
if($this->config->edition != 'open')
|
||||
if($this->loadModel('effort'))
|
||||
{
|
||||
$fields = 'id,dates,consumed,left,objectType,objectID,work';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
Reference in New Issue
Block a user