begin work on fixing tasks
This commit is contained in:
parent
dd21d24856
commit
1b8ff46ccf
@ -356,8 +356,21 @@
|
|||||||
return $json;
|
return $json;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResponse($element)
|
public function getResponse($element, InstanceReference|null $relatedInstance = null) // , array|null $workData = null)
|
||||||
{
|
{
|
||||||
|
if ($relatedInstance !== null)
|
||||||
|
{
|
||||||
|
$workDataPost = array("relatedInstance" => $relatedInstance->InstanceKey);
|
||||||
|
/*
|
||||||
|
$workDataPost = array();
|
||||||
|
foreach ($workData as $key => $value)
|
||||||
|
{
|
||||||
|
$workDataPost[UUID::parse($key)->__toString()] = strval($value);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
$json = $this->curl_request_json("/tenants/" . $this->getTenantName() . "/instances/" . $element->InstanceKey . "/element", HttpRequestMethod::POST, $workDataPost);
|
||||||
|
return $json;
|
||||||
|
}
|
||||||
$json = $this->curl_request_json("/tenants/" . $this->getTenantName() . "/instances/" . $element->InstanceKey . "/element");
|
$json = $this->curl_request_json("/tenants/" . $this->getTenantName() . "/instances/" . $element->InstanceKey . "/element");
|
||||||
return $json;
|
return $json;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
use Mocha\Core\InstanceKey;
|
use Mocha\Core\InstanceKey;
|
||||||
use Mocha\Core\InstanceReference;
|
use Mocha\Core\InstanceReference;
|
||||||
|
use Mocha\Core\KnownInstanceGuids;
|
||||||
use Mocha\Core\OmsContext;
|
use Mocha\Core\OmsContext;
|
||||||
use Mocha\UI\Controls\InstanceBrowser;
|
use Mocha\UI\Controls\InstanceBrowser;
|
||||||
use Phast\System;
|
use Phast\System;
|
||||||
@ -112,18 +113,33 @@
|
|||||||
{
|
{
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST")
|
if ($_SERVER["REQUEST_METHOD"] == "POST")
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$json = $this->OMS->getResponse(element: $task);
|
// FIXME: pass in work data parms as array e.g.
|
||||||
|
//? getResponse($task, array( RELATED_INSTANCE => $relatedInstance ))
|
||||||
|
$workData = null;
|
||||||
|
/*
|
||||||
|
if ($relatedInstance !== null)
|
||||||
|
{
|
||||||
|
$workData = array
|
||||||
|
(
|
||||||
|
KnownInstanceGuids::WorkSet__TaskRelatedInstance => $relatedInstance->GlobalIdentifier
|
||||||
|
);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
$json = $this->OMS->getResponse($task, $relatedInstance);
|
||||||
if ($json["result"] == "success") {
|
if ($json["result"] == "success") {
|
||||||
$title = $json["value"]["title"]["label"];
|
$title = $json["value"]["title"]["label"];
|
||||||
|
|
||||||
$this->renderResponse($json["value"]);
|
$this->renderResponse($json["value"]);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
|
||||||
|
{
|
||||||
|
print_r($json);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
echo ("renderTask: " . $task->InstanceKey);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -186,6 +186,11 @@
|
|||||||
$viewTask = $results[$i]->DefaultTask; // $oms->getRelatedInstance($instClass, KnownRelationshipGuids::Class__has_default__Task);
|
$viewTask = $results[$i]->DefaultTask; // $oms->getRelatedInstance($instClass, KnownRelationshipGuids::Class__has_default__Task);
|
||||||
# $uri = "/" . $oms->getTenantName() . "/d/inst/" . $inst->InstanceKey->__toString() . ".htmld";
|
# $uri = "/" . $oms->getTenantName() . "/d/inst/" . $inst->InstanceKey->__toString() . ".htmld";
|
||||||
$uri = $results[$i]->DefaultTaskUrl;
|
$uri = $results[$i]->DefaultTaskUrl;
|
||||||
|
|
||||||
|
if ($inst->InstanceKey->ClassIndex == 2997)
|
||||||
|
{
|
||||||
|
$uri = "/" . $oms->getTenantName() . "/d/task/" . $inst->InstanceKey->__toString() . ".htmld";
|
||||||
|
}
|
||||||
# if ($inst->ParentClass->InstanceKey->InstanceIndex == 2997)
|
# if ($inst->ParentClass->InstanceKey->InstanceIndex == 2997)
|
||||||
{
|
{
|
||||||
# $uri = "/" . $oms->getTenantName() . "/d/task/" . $inst->InstanceKey->__toString() . ".htmld";
|
# $uri = "/" . $oms->getTenantName() . "/d/task/" . $inst->InstanceKey->__toString() . ".htmld";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user