* code for task #44938.
This commit is contained in:
@@ -27,18 +27,48 @@ class executionEntry extends Entry
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data or !isset($data->status)) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail')
|
||||
{
|
||||
return isset($data->code) and $data->code == 404 ? $this->send404() : $this->sendError(400, $data->message);
|
||||
}
|
||||
if(isset($data->status) and $data->status == 'fail') return isset($data->code) and $data->code == 404 ? $this->send404() : $this->sendError(400, $data->message);
|
||||
|
||||
$execution = $this->format($data->data->execution, 'openedDate:time,lastEditedDate:time,closedDate:time,canceledDate:time,begin:date,end:date,realBegan:date,realEnd:date,deleted:bool');
|
||||
|
||||
$accounts = array();
|
||||
$accounts[$execution->PO] = $execution->PO;
|
||||
$accounts[$execution->PM] = $execution->PM;
|
||||
$accounts[$execution->QD] = $execution->QD;
|
||||
$accounts[$execution->RD] = $execution->RD;
|
||||
$users = $this->loadModel('user')->getListByAccounts($accounts, 'account');
|
||||
|
||||
$execution->PO = zget($users, $execution->PO, '');
|
||||
$execution->PM = zget($users, $execution->PM, '');
|
||||
$execution->QD = zget($users, $execution->QD, '');
|
||||
$execution->RD = zget($users, $execution->RD, '');
|
||||
|
||||
$execution->progress = ($execution->totalConsumed + $execution->totalLeft) ? round($execution->totalConsumed / ($execution->totalConsumed + $execution->totalLeft) * 100, 1) : 0;
|
||||
$execution->teamMembers = array_values((array)$data->data->teamMembers);
|
||||
$execution->products = array();
|
||||
foreach($data->data->products as $productID => $executionProduct)
|
||||
{
|
||||
$product = new stdclass();
|
||||
$product->id = $executionProduct->id;
|
||||
$product->name = $executionProduct->name;
|
||||
$product->plans = array();
|
||||
foreach($executionProduct->plans as $planID)
|
||||
{
|
||||
$plan = new stdclass();
|
||||
$plan->id = $planID;
|
||||
$plan->name = $data->data->planGroups->{$productID}->{$planID};
|
||||
$product->plans[] = $plan;
|
||||
}
|
||||
$execution->products[] = $product;
|
||||
}
|
||||
|
||||
$this->loadModel('testcase');
|
||||
$execution->caseReview = ($this->config->testcase->needReview or !empty($this->config->testcase->forceReview));
|
||||
|
||||
if(!$fields) $this->send(200, $execution);
|
||||
|
||||
$users = $data->data->users;
|
||||
|
||||
/* Set other fields. */
|
||||
$fields = explode(',', strtolower($fields));
|
||||
foreach($fields as $field)
|
||||
@@ -67,6 +97,14 @@ class executionEntry extends Entry
|
||||
|
||||
$execution->stories = array_values($stories);
|
||||
break;
|
||||
case 'actions':
|
||||
$actions = $data->data->actions;
|
||||
$execution->actions = $this->loadModel('action')->processActionForAPI($actions, $users, $this->lang->execution);
|
||||
break;
|
||||
case "dynamics":
|
||||
$dynamics = $data->data->dynamics;
|
||||
$execution->dynamics = $this->loadModel('action')->processDynamicForAPI($dynamics);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,12 @@ class router extends baseRouter
|
||||
unset($lang->{$moduleName}->{$section});
|
||||
|
||||
if(isset($nullKey))$lang->{$moduleName}->{$section}[$nullKey] = $nullValue;
|
||||
foreach($fields as $key => $value) $lang->{$moduleName}->{$section}[$key] = $value;
|
||||
foreach($fields as $key => $value)
|
||||
{
|
||||
if(!isset($lang->{$moduleName})) $lang->{$moduleName} = new stdclass();
|
||||
if(!isset($lang->{$moduleName}->{$section})) $lang->{$moduleName}->{$section} = array();
|
||||
$lang->{$moduleName}->{$section}[$key] = $value;
|
||||
}
|
||||
unset($nullKey);
|
||||
unset($nullValue);
|
||||
}
|
||||
|
||||
@@ -549,8 +549,11 @@ class executionModel extends model
|
||||
}
|
||||
if(isset($execution->project) and $execution->project) $this->addProjectMembers($execution->project, $teamMembers);
|
||||
|
||||
$whitelist = explode(',', $execution->whitelist);
|
||||
$this->loadModel('personnel')->updateWhitelist($whitelist, 'sprint', $executionID);
|
||||
if(!empty($execution->whitelist))
|
||||
{
|
||||
$whitelist = explode(',', $execution->whitelist);
|
||||
$this->loadModel('personnel')->updateWhitelist($whitelist, 'sprint', $executionID);
|
||||
}
|
||||
|
||||
/* Fix bug#3074, Update views for team members. */
|
||||
if($execution->acl != 'open') $this->updateUserView($executionID, 'sprint', $changedAccounts);
|
||||
|
||||
Reference in New Issue
Block a user