Compare commits
7 Commits
4da713ae56
...
b7b424847f
| Author | SHA1 | Date | |
|---|---|---|---|
| b7b424847f | |||
| da3bb6a2b7 | |||
| f90923fd0f | |||
| 67fd22229f | |||
| 35550babf0 | |||
| 0217502488 | |||
| 0716661402 |
@ -75,7 +75,12 @@ System::$BeforeLaunchEventHandler = function($path)
|
||||
|
||||
if (count($path) == 0)
|
||||
{
|
||||
System::Redirect("~/" . System::$Configuration["Application.DefaultTenant"], true);
|
||||
$defaultTenantName = System::$Configuration["Application.DefaultTenant"];
|
||||
if (isset($_ENV["DEFAULT_TENANTNAME"]))
|
||||
{
|
||||
$defaultTenantName = $_ENV["DEFAULT_TENANTNAME"];
|
||||
}
|
||||
System::Redirect("~/" . $defaultTenantName, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -167,6 +167,8 @@ function mocha_init_spot_timer($pg) : bool
|
||||
if ($pg === null)
|
||||
return false;
|
||||
|
||||
return false;
|
||||
|
||||
$literalSpotTimer = $pg->GetControlByID("literalSpotTimer");
|
||||
$spotTimerInitializationScript = $pg->GetControlByID("spotTimerInitializationScript");
|
||||
if ($literalSpotTimer === null || $spotTimerInitializationScript === null)
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING);
|
||||
|
||||
require_once ("lib/phast/Compilers/StyleSheet/LESS/Internal/LessStyleSheetCompiler.inc.php");
|
||||
require_once ("lib/phast/Compilers/StyleSheet/LESS/Internal/Formatters/CompressedFormatter.inc.php");
|
||||
|
||||
@ -204,7 +204,7 @@
|
||||
}
|
||||
public function search(string $query, array | InstanceReference | null $parentClasses = null, string | null $m = null) : array | bool
|
||||
{
|
||||
$uri = "/tenants/super/instances?";
|
||||
$uri = "/tenants/" . $this->getTenantName() . "/instances?";
|
||||
|
||||
if ($m != null)
|
||||
{
|
||||
@ -363,6 +363,7 @@
|
||||
$url = "/tenants/" . $this->getTenantName() . "/instances/" . $element->InstanceKey . "/element";
|
||||
if ($relatedInstance !== null)
|
||||
{
|
||||
echo ("POST " . $url);
|
||||
// related instance is passed in by:
|
||||
// UI Task.has Related Menu Item
|
||||
// -> Related Menu Item.uses object of Class
|
||||
@ -378,9 +379,14 @@
|
||||
$workDataPost[UUID::parse($key)->__toString()] = strval($value);
|
||||
}
|
||||
*/
|
||||
print_r($workDataPost);
|
||||
$json = $this->curl_request_json($url, HttpRequestMethod::POST, $workDataPost);
|
||||
return $json;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo ("GET " . $url . "\n");
|
||||
}
|
||||
$json = $this->curl_request_json($url);
|
||||
return $json;
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ function McxMoniker(parentElement)
|
||||
|
||||
var url = System.ExpandRelativePath("~/" + System.TenantName + "/inst/" + this.InstanceID + "/rel-tasks.htmld");
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.timeout = 5000;
|
||||
xhr.timeout = 10000;
|
||||
xhr.open("GET", url);
|
||||
xhr.thiss = this;
|
||||
xhr.onreadystatechange = function(e)
|
||||
|
||||
@ -1,24 +1,6 @@
|
||||
<Website>
|
||||
<Pages>
|
||||
<Page MasterPageFileName="masterPages/Blank.phpx" FileName="{tenant}/d/inst/{instid}.htmld" CodeBehindClassName="Mocha\UI\Pages\InstancePage">
|
||||
<References>
|
||||
<Reference TagPrefix="html" NamespacePath="Phast\HTMLControls" />
|
||||
<Reference TagPrefix="wcx" NamespacePath="Phast\WebControls" />
|
||||
</References>
|
||||
<Content>
|
||||
<wcx:Section PlaceholderID="aspcContent">
|
||||
<div style="display: block;">
|
||||
</div>
|
||||
</wcx:Section>
|
||||
</Content>
|
||||
</Page>
|
||||
<Page MasterPageFileName="masterPages/Blank.phpx" FileName="{tenant}/d/inst/{castinstid}/{instid}.htmld" CodeBehindClassName="Mocha\UI\Pages\InstancePage">
|
||||
<References>
|
||||
<Reference TagPrefix="html" NamespacePath="Phast\HTMLControls" />
|
||||
<Reference TagPrefix="wcx" NamespacePath="Phast\WebControls" />
|
||||
</References>
|
||||
<Content>
|
||||
</Content>
|
||||
</Page>
|
||||
<Page MasterPageFileName="masterPages/Blank.phpx" FileName="{tenant}/d/inst/{instid}.htmld" CodeBehindClassName="Mocha\UI\Pages\InstancePage" />
|
||||
<Page MasterPageFileName="masterPages/Blank.phpx" FileName="{tenant}/d/inst/{castinstid}/{instid}.htmld" CodeBehindClassName="Mocha\UI\Pages\InstancePage" />
|
||||
</Pages>
|
||||
</Website>
|
||||
@ -21,168 +21,25 @@
|
||||
protected function OnRendering(RenderingEventArgs $re)
|
||||
{
|
||||
parent::OnRendering($re);
|
||||
|
||||
$useLegacyRendering = false;
|
||||
if (isset($_GET["useLegacyRendering"]) && $_GET["useLegacyRendering"] == true)
|
||||
{
|
||||
$useLegacyRendering = true;
|
||||
}
|
||||
$re->Cancel = true;
|
||||
|
||||
$oms = mocha_get_oms();
|
||||
$useRendererV2 = true;
|
||||
|
||||
$ctx = new OmsContext();
|
||||
if ($useRendererV2)
|
||||
{
|
||||
$htmlRenderer = new HTMLRenderer2($ctx);
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmlRenderer = new HTMLRenderer($ctx);
|
||||
}
|
||||
$htmlRenderer = new HTMLRenderer2($ctx);
|
||||
$htmlRenderer->CodeBehindFileName = "InstancePage";
|
||||
|
||||
$instkey = InstanceKey::parse($this->Page->GetPathVariableValue("instid"));
|
||||
|
||||
$castkey = InstanceKey::parse($this->Page->GetPathVariableValue("castinstid"));
|
||||
|
||||
echo ("@ getInstanceByKey<br />");
|
||||
$inst = $oms->getInstanceByKey($instkey);
|
||||
|
||||
echo ("@ getResponse<br />");
|
||||
$json = $oms->getResponse($inst, $inst);
|
||||
echo ("@ renderResponse<br />");
|
||||
|
||||
echo ("<!-- ");
|
||||
$json = $oms->getResponse($inst, null);
|
||||
print_r($json);
|
||||
echo ("-->");
|
||||
$htmlRenderer->renderResponse($json["value"]);
|
||||
return;
|
||||
|
||||
if ($inst === null)
|
||||
{
|
||||
$htmlRenderer->renderBeginPage("Error");
|
||||
?>
|
||||
<div class="uwt-panel" style="width: 600px; margin-left: auto; margin-right: auto; margin-top: 128px;">
|
||||
<div class="uwt-header">
|
||||
<h1>Invalid Instance</h1>
|
||||
</div>
|
||||
<div class="uwt-content">
|
||||
<p><?php echo("Invalid inst id " . $instkey . " (inst not found)"); ?></p>
|
||||
</div>
|
||||
<div class="uwt-footer">
|
||||
<a href="#">Back</a>
|
||||
</div>
|
||||
</div><?php
|
||||
$htmlRenderer->renderEndPage();
|
||||
|
||||
exit();
|
||||
|
||||
$instIdCtl = $this->Page->GetControlByID("instId");
|
||||
$castIdCtl = $this->Page->GetControlByID("castId");
|
||||
|
||||
if ($castIdCtl !== null)
|
||||
{
|
||||
if ($castkey === null)
|
||||
{
|
||||
$castIdCtl->Content = "invalid inst id " . $castkey . " (inst not found)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$castIdCtl->Content = strval($castkey);
|
||||
}
|
||||
}
|
||||
|
||||
$instIdCtl->Content = "invalid inst id " . $instkey . " (inst not found)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$parentClass = $oms->getParentClass($inst);
|
||||
if ($castkey !== null)
|
||||
{
|
||||
$parentClass = $oms->getInstanceByKey($castkey);
|
||||
}
|
||||
|
||||
if (!$useLegacyRendering)
|
||||
{
|
||||
$htmlRenderer->renderInitialElement($inst);
|
||||
exit();
|
||||
}
|
||||
|
||||
$rel_Class__has_default__Task = $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Class__has_default__Task);
|
||||
if ($rel_Class__has_default__Task !== null)
|
||||
{
|
||||
$defaultTask = $oms->getRelatedInstance($parentClass, $rel_Class__has_default__Task);
|
||||
if ($defaultTask !== null)
|
||||
{
|
||||
$context = new OmsContext();
|
||||
$initiatingElement = $oms->getRelatedInstance($defaultTask, KnownRelationshipGuids::Task__has_initiating__Element);
|
||||
|
||||
$context->setWorkData($oms->normalizeInstanceReference(KnownInstanceGuids::WorkSet__RelatedInstance), $inst);
|
||||
$context->setWorkData($parentClass, $inst);
|
||||
|
||||
// echo ("instance for " . $parentClass->InstanceKey . " = " . $inst->InstanceKey);
|
||||
$htmlRenderer->TargetInstance = $inst;
|
||||
$htmlRenderer->IsPostback = $this->Page->IsPostback;
|
||||
if ($this->Page->IsPostback)
|
||||
{
|
||||
$htmlRenderer->processPostback(element: $initiatingElement);
|
||||
}
|
||||
$htmlRenderer->renderTask($defaultTask, $inst);
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmlRenderer->renderBeginPage("View Instance [Hardcoded]");
|
||||
|
||||
$htmlRenderer->renderPageHeader("View Instance [Hardcoded]", $inst);
|
||||
$htmlRenderer->renderBeginContent();
|
||||
|
||||
$htmlRenderer->renderBeginTag("div", [ ], [ "uwt-formview", "mcx-element" ]);
|
||||
|
||||
$htmlRenderer->renderBeginTag("div", [ ], [ "mcx-elementcontent", "uwt-formview-item" ]);
|
||||
|
||||
$htmlRenderer->renderBeginTag("div", [ ], [ "uwt-formview-item-label" ]);
|
||||
$htmlRenderer->renderBeginTag("label",[ ], [ ]);
|
||||
echo("Instance");
|
||||
$htmlRenderer->renderEndTag("label");
|
||||
$htmlRenderer->renderEndTag("div");
|
||||
|
||||
$htmlRenderer->renderBeginTag("div", [ ], [ "uwt-formview-item-content" ]);
|
||||
$htmlRenderer->renderEndTag("div");
|
||||
|
||||
$adw = new InstanceBrowser();
|
||||
$adw->SelectedInstances[] = $inst;
|
||||
$adw->Render();
|
||||
|
||||
$htmlRenderer->renderEndTag("div");
|
||||
|
||||
$htmlRenderer->renderBeginTag("div", [ ], [ "mcx-elementcontent", "uwt-formview-item" ]);
|
||||
|
||||
$htmlRenderer->renderBeginTag("div", [ ], [ "uwt-formview-item-label" ]);
|
||||
$htmlRenderer->renderBeginTag("label",[ ], [ ]);
|
||||
echo("Parent Class");
|
||||
$htmlRenderer->renderEndTag("label");
|
||||
$htmlRenderer->renderEndTag("div");
|
||||
|
||||
$htmlRenderer->renderBeginTag("div", [ ], [ "uwt-formview-item-content" ]);
|
||||
$htmlRenderer->renderEndTag("div");
|
||||
|
||||
|
||||
$adw = new InstanceBrowser();
|
||||
$adw->SelectedInstances[] = $parentClass;
|
||||
$adw->Render();
|
||||
|
||||
|
||||
$htmlRenderer->renderEndTag("div");
|
||||
|
||||
$htmlRenderer->renderEndTag("div");
|
||||
|
||||
$htmlRenderer->renderEndContent();
|
||||
}
|
||||
}
|
||||
|
||||
$htmlRenderer->renderEndPage();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -175,7 +175,7 @@ function McxMoniker(parentElement)
|
||||
|
||||
var url = System.ExpandRelativePath("~/" + System.TenantName + "/inst/" + this.InstanceID + "/rel-tasks.htmld");
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.timeout = 5000;
|
||||
xhr.timeout = 10000;
|
||||
xhr.open("GET", url);
|
||||
xhr.thiss = this;
|
||||
xhr.onreadystatechange = function(e)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user