initial commit
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.exclude
|
||||
9
sql/tables/bst_events.sql
Normal file
@ -0,0 +1,9 @@
|
||||
DROP TABLE IF EXISTS bst_events;
|
||||
|
||||
CREATE TABLE bst_events
|
||||
(
|
||||
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
start_datetime DATETIME NOT NULL,
|
||||
end_datetime DATETIME,
|
||||
comment TEXT
|
||||
);
|
||||
8
sql/tables/bst_kids.sql
Normal file
@ -0,0 +1,8 @@
|
||||
DROP TABLE IF EXISTS bst_kids;
|
||||
|
||||
CREATE TABLE bst_kids
|
||||
(
|
||||
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
name VARCHAR(50),
|
||||
cost DECIMAL(15, 2)
|
||||
);
|
||||
8
sql/tables/bst_kids_cost.sql
Normal file
@ -0,0 +1,8 @@
|
||||
DROP TABLE IF EXISTS bst_kids_cost;
|
||||
|
||||
CREATE TABLE bst_kids_cost
|
||||
(
|
||||
location_id INT NOT NULL,
|
||||
kid_id INT NOT NULL,
|
||||
cost DECIMAL(15, 2)
|
||||
);
|
||||
7
sql/tables/bst_locations.sql
Normal file
@ -0,0 +1,7 @@
|
||||
DROP TABLE IF EXISTS bst_locations;
|
||||
|
||||
CREATE TABLE bst_locations
|
||||
(
|
||||
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
name VARCHAR(50)
|
||||
);
|
||||
7
sql/tables/bst_permissions.sql
Normal file
@ -0,0 +1,7 @@
|
||||
DROP TABLE IF EXISTS bst_permissions;
|
||||
|
||||
CREATE TABLE bst_permissions
|
||||
(
|
||||
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
title VARCHAR(50)
|
||||
);
|
||||
9
sql/tables/bst_sessions.sql
Normal file
@ -0,0 +1,9 @@
|
||||
DROP TABLE IF EXISTS bst_sessions;
|
||||
|
||||
CREATE TABLE bst_sessions
|
||||
(
|
||||
session_tag CHAR(32) NOT NULL,
|
||||
user_id INT NOT NULL,
|
||||
start_datetime DATETIME NOT NULL,
|
||||
ip_address CHAR(50)
|
||||
);
|
||||
7
sql/tables/bst_timezones.sql
Normal file
@ -0,0 +1,7 @@
|
||||
DROP TABLE IF EXISTS bst_timezones;
|
||||
|
||||
CREATE TABLE bst_timezones
|
||||
(
|
||||
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
name VARCHAR(50)
|
||||
);
|
||||
7
sql/tables/bst_user_permissions.sql
Normal file
@ -0,0 +1,7 @@
|
||||
DROP TABLE IF EXISTS bst_user_permissions;
|
||||
|
||||
CREATE TABLE bst_user_permissions
|
||||
(
|
||||
user_id INT NOT NULL,
|
||||
permission_id INT NOT NULL
|
||||
);
|
||||
9
sql/tables/bst_users.sql
Normal file
@ -0,0 +1,9 @@
|
||||
DROP TABLE IF EXISTS bst_users;
|
||||
|
||||
CREATE TABLE bst_users
|
||||
(
|
||||
user_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
username VARCHAR(50),
|
||||
password_hash CHAR(128),
|
||||
password_salt CHAR(32)
|
||||
);
|
||||
5
webapp/.htaccess
Normal file
@ -0,0 +1,5 @@
|
||||
RewriteEngine on
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.+) index.php?vp=$1 [PT,L,QSA]
|
||||
7
webapp/MochaIDE.inc.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
use MBS\Web\WebApplication;
|
||||
|
||||
class MochaIDE extends WebApplication
|
||||
{
|
||||
}
|
||||
?>
|
||||
98
webapp/bst/BSTApplication.inc.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
use Mocha\Core\InstanceReference;
|
||||
|
||||
use Mocha\UI\DisplayOption;
|
||||
use Mocha\UI\ElementContent;
|
||||
|
||||
use MBS\Web\WebApplication;
|
||||
use MBS\Web\WebPage;
|
||||
|
||||
class BSTApplication extends WebApplication
|
||||
{
|
||||
public function OnInitialize()
|
||||
{
|
||||
if (!isset($_SESSION["user_token"]))
|
||||
{
|
||||
header("Location: login.php");
|
||||
return true;
|
||||
}
|
||||
|
||||
$ses = null;
|
||||
$current_user = null;
|
||||
$users = sqlexec("SELECT * FROM bst_sessions WHERE session_tag = :session_tag ORDER BY start_datetime LIMIT 1", array("session_tag" => $_SESSION["user_token"]));
|
||||
foreach ($users as $user)
|
||||
{
|
||||
$ses = $user;
|
||||
break;
|
||||
}
|
||||
|
||||
$user_id = $ses["user_id"];
|
||||
$current_user = sqlexec1("SELECT bst_users.* FROM bst_users WHERE bst_users.id = :user_id", array("user_id" => $user_id));
|
||||
$tz = null;
|
||||
if ($current_user["timezone_id"] != null)
|
||||
{
|
||||
$tz = sqlexec1("SELECT * FROM bst_timezones WHERE id = :timezone_id", array("timezone_id" => $current_user["timezone_id"]));
|
||||
}
|
||||
|
||||
$this->Variables["current_user_id"] = $current_user["id"];
|
||||
$this->Variables["current_user_title"] = $current_user["title"];
|
||||
if ($tz != null)
|
||||
{
|
||||
date_default_timezone_set($tz["name"]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function OnPostback()
|
||||
{
|
||||
if ($_POST["submit_action"] == "add_event")
|
||||
{
|
||||
$event_id = sqlexecl("INSERT INTO bst_events (start_datetime, comment) VALUES (NOW(), :comment)", array("comment" => $_POST["comment"]));
|
||||
|
||||
$kids = sqlexec("SELECT * FROM bst_kids");
|
||||
$kidlocs = array();
|
||||
|
||||
foreach ($kids as $kid)
|
||||
{
|
||||
$kidlocs[$kid["id"]] = ($_POST["kid_" . $kid["id"] . "_location"]);
|
||||
}
|
||||
foreach ($kids as $kid)
|
||||
{
|
||||
$kid_id = $kid["id"];
|
||||
$location_id = $kidlocs[$kid_id];
|
||||
|
||||
sqlexec("INSERT INTO bst_event_kids (event_id, kid_id, location_id) VALUES (:event_id, :kid_id, :location_id)", array("event_id" => $event_id, "kid_id" => $kid_id, "location_id" => $location_id));
|
||||
}
|
||||
|
||||
header("Location: /bst");
|
||||
return;
|
||||
}
|
||||
else if (isset($_POST["end_event"]))
|
||||
{
|
||||
$event_id = $_POST["end_event"];
|
||||
sqlexec("UPDATE bst_events SET end_datetime = NOW() WHERE id = :event_id", array("event_id" => $event_id));
|
||||
|
||||
header("Location: /bst");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function get_kid_name($kid_id)
|
||||
{
|
||||
$kk = sqlexec("SELECT name FROM bst_kids WHERE id = :kid_id", array("kid_id" => $kid_id));
|
||||
$name = $kk[0]["name"];
|
||||
return $name;
|
||||
}
|
||||
function get_kid_rate($kid_id)
|
||||
{
|
||||
$kk = sqlexec("SELECT cost FROM bst_kids WHERE id = :kid_id", array("kid_id" => $kid_id));
|
||||
$name = $kk[0]["cost"];
|
||||
return $name;
|
||||
}
|
||||
function get_location_name($location_id)
|
||||
{
|
||||
$kk = sqlexec("SELECT name FROM bst_locations WHERE id = :location_id", array("location_id" => $location_id));
|
||||
$loc = $kk[0]["name"];
|
||||
return $loc;
|
||||
}
|
||||
?>
|
||||
9
webapp/fonts/awesome.bak/all.min.css
vendored
Normal file
BIN
webapp/fonts/awesome.bak/fa-brands-400.ttf
Normal file
BIN
webapp/fonts/awesome.bak/fa-brands-400.woff2
Normal file
BIN
webapp/fonts/awesome.bak/fa-regular-400.ttf
Normal file
BIN
webapp/fonts/awesome.bak/fa-regular-400.woff2
Normal file
BIN
webapp/fonts/awesome.bak/fa-solid-900.ttf
Normal file
BIN
webapp/fonts/awesome.bak/fa-solid-900.woff2
Normal file
BIN
webapp/fonts/awesome.bak/fa-v4compatibility.ttf
Normal file
BIN
webapp/fonts/awesome.bak/fa-v4compatibility.woff2
Normal file
12
webapp/fonts/awesome/css/all.min.css
vendored
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-brands-400.ttf
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-brands-400.woff2
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-duotone-900.ttf
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-duotone-900.woff2
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-light-300.ttf
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-light-300.woff2
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-regular-400.ttf
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-regular-400.woff2
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-solid-900.ttf
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-solid-900.woff2
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-thin-100.ttf
Normal file
BIN
webapp/fonts/awesome/webfonts/fa-thin-100.woff2
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-Black.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-BlackItalic.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-Bold.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-BoldItalic.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-ExtraBold.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-ExtraBoldItalic.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-ExtraLight.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-ExtraLightItalic.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-Italic.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-Light.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-LightItalic.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-Medium.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-MediumItalic.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-Regular.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-SemiBold.ttf
Normal file
BIN
webapp/fonts/source/code/SourceCodePro-SemiBoldItalic.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-Black.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-BlackItalic.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-Bold.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-BoldItalic.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-ExtraBold.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-ExtraBoldItalic.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-ExtraLight.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-ExtraLightItalic.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-Italic.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-Light.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-LightItalic.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-Medium.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-MediumItalic.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-Regular.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-SemiBold.ttf
Normal file
BIN
webapp/fonts/source/sans/SourceSans3-SemiBoldItalic.ttf
Normal file
4
webapp/fx/system.inc.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
require_once("web/WebApplication.inc.php");
|
||||
require_once("web/WebPage.inc.php");
|
||||
?>
|
||||
79
webapp/fx/web/WebApplication.inc.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
namespace MBS\Web;
|
||||
|
||||
class WebApplication
|
||||
{
|
||||
public $ApplicationRoot;
|
||||
public $Pages;
|
||||
public $Variables;
|
||||
|
||||
public static $Current;
|
||||
|
||||
public function __construct($root)
|
||||
{
|
||||
$this->ApplicationRoot = $root;
|
||||
$this->Pages = array();
|
||||
$this->Variables = array();
|
||||
}
|
||||
|
||||
public function ExpandRelativePath($path)
|
||||
{
|
||||
if (substr($path, 0, 2) == "~/")
|
||||
{
|
||||
return $this->ApplicationRoot . "/" . substr($path, 2);
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
|
||||
private function _IsPostback()
|
||||
{
|
||||
// thanks https://stackoverflow.com/questions/4242035
|
||||
return strtoupper($_SERVER['REQUEST_METHOD']) === 'POST';
|
||||
//&& (basename($_SERVER['HTTP_REFERER']) == $_SERVER['SCRIPT_NAME']));
|
||||
}
|
||||
|
||||
public function OnInitialize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public function OnPostback()
|
||||
{
|
||||
}
|
||||
|
||||
public function Start()
|
||||
{
|
||||
WebApplication::$Current = $this;
|
||||
if ($this->OnInitialize())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->_IsPostback())
|
||||
{
|
||||
$this->OnPostback();
|
||||
}
|
||||
|
||||
foreach ($this->Pages as $page)
|
||||
{
|
||||
$path = $_SERVER["REQUEST_URI"];
|
||||
$rp = substr($path, strlen($this->ApplicationRoot));
|
||||
|
||||
$my_path = $page->Path;
|
||||
if (strlen($my_path) == 0)
|
||||
{
|
||||
$my_path = "/";
|
||||
}
|
||||
else if (substr($my_path, 0, 1) != "/")
|
||||
{
|
||||
$my_path = "/" . $my_path;
|
||||
}
|
||||
|
||||
if ($rp == $my_path)
|
||||
{
|
||||
$page->Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
23
webapp/fx/web/WebPage.inc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace MBS\Web;
|
||||
|
||||
class WebPage
|
||||
{
|
||||
public $Path;
|
||||
public $Function;
|
||||
|
||||
public function __construct($path, $func)
|
||||
{
|
||||
$this->Path = $path;
|
||||
$this->Function = $func;
|
||||
}
|
||||
|
||||
public function Render()
|
||||
{
|
||||
if (is_callable($this->Function))
|
||||
{
|
||||
call_user_func($this->Function);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
163
webapp/ide.php
Normal file
@ -0,0 +1,163 @@
|
||||
<?php
|
||||
session_start();
|
||||
require("system.inc.php");
|
||||
|
||||
if (!isset($_SESSION["user_token"]))
|
||||
{
|
||||
$_SESSION["LoginRedirectURL"] = "bst/mocha";
|
||||
header("Location: login.php");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isset($_GET["vp"]))
|
||||
{
|
||||
$virtualPath = explode("/", $_GET["vp"]);
|
||||
}
|
||||
|
||||
require("fx/system.inc.php");
|
||||
require("MochaIDE.inc.php");
|
||||
$ide = new MochaIDE(get_virtual_path_root(__FILE__));
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>Mocha IDE</title>
|
||||
<link rel="stylesheet" type="text/css" href="style/main.css" />
|
||||
<style type="text/css">
|
||||
div.tx-wrapper
|
||||
{
|
||||
border: solid 1px #aaaaaa;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
div.tx-toolbar
|
||||
{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 16px;
|
||||
background-color: #eee;
|
||||
}
|
||||
div.tx-toolbar > a.uwt-button
|
||||
{
|
||||
|
||||
}
|
||||
@media (min-width: 1000px)
|
||||
{
|
||||
div.tx-wrapper
|
||||
{
|
||||
width: 80%;
|
||||
margin-top: 128px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
}
|
||||
div.tx
|
||||
{
|
||||
color: #000000;
|
||||
font-family: monospace;
|
||||
font-size: 10pt;
|
||||
padding: 16px;
|
||||
}
|
||||
div.tx a
|
||||
{
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
div.tx a:hover
|
||||
{
|
||||
text-decoration: underline;
|
||||
}
|
||||
div.tx a.uwt-button
|
||||
{
|
||||
display: inline-block;
|
||||
min-width: auto;
|
||||
min-height: auto;
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
margin: 4px;
|
||||
color: #676a6c;
|
||||
text-decoration: none;
|
||||
}
|
||||
div.tx span.tx-keyword
|
||||
{
|
||||
color: #0000aa;
|
||||
font-weight: bold;
|
||||
}
|
||||
div.tx span.tx-category
|
||||
{
|
||||
color: #003366;
|
||||
font-weight: bold;
|
||||
}
|
||||
div.tx .tx-reference
|
||||
{
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
}
|
||||
div.tx .tx-reference > i
|
||||
{
|
||||
opacity: 0;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 0px;
|
||||
}
|
||||
div.tx .tx-reference::before
|
||||
{
|
||||
font-family: "FontAwesome";
|
||||
content: "\f061";
|
||||
}
|
||||
div.tx span.tx-class
|
||||
{
|
||||
color: #660066;
|
||||
font-weight: bold;
|
||||
}
|
||||
div.tx div.tx-indent
|
||||
{
|
||||
padding-left: 24px;
|
||||
}
|
||||
div.tx .tx-comment
|
||||
{
|
||||
color: #aaaaaa;
|
||||
}
|
||||
div.tx .tx-instance
|
||||
{
|
||||
color: #006666;
|
||||
}
|
||||
div.tx > div:hover
|
||||
{
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="uwt-layout uwt-layout-box uwt-orientation-vertical">
|
||||
<div class="uwt-header uwt-layout uwt-layout-box uwt-orientation-horizontal">
|
||||
<label>Mocha IDE v0.3.2023.10 rev 301138</label>
|
||||
</div>
|
||||
<div class="tx-wrapper">
|
||||
<div class="tx-toolbar">
|
||||
<div style="margin-left: auto;">
|
||||
<a class="uwt-button uwt-color-primary" href="#"><i class="fa fa-download"></i><span class="uwt-title">Download Class Definition</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tx" style="flex-grow: 1;">
|
||||
<div><span class="tx-keyword">class</span> <a href="<?php echo($ide->ExpandRelativePath("~/d/inst/1$2342.htmld")); ?>">Test, 1$2342</a> { </div>
|
||||
<div> </div>
|
||||
<div><span class="tx-category">attributes:</span> <a class="uwt-button" href="#"><i class="fa fa-plus"></i> <span class="uwt-title">add</span></a></div>
|
||||
<div class="tx-indent">name, 4$1 : <span class="tx-keyword">text</span></div>
|
||||
<div class="tx-indent">order, 4$7 : <span class="tx-keyword">text</span></div>
|
||||
<div> </div>
|
||||
<div><span class="tx-category">relationships:</span> <a class="uwt-button" href="#"><i class="fa fa-plus"></i> <span class="uwt-title">add</span></a></div>
|
||||
<div class="tx-indent"><a href="#">forTestClass, 3$11347</a> <span class="tx-reference"><i>-></i> referenced by <span class="tx-class"><a href="#">TestClass*</a></span></span></div>
|
||||
<div> </div>
|
||||
<div><span class="tx-category">functions:</span> <a class="uwt-button" href="#"><i class="fa fa-plus"></i> <span class="uwt-title">add</span></a></div>
|
||||
<div class="tx-comment tx-indent">/**<br/ >formerly known as: <a href="#">Test@get Test Class(GRS)*S(public), 40$123748</a><br /><br />@return the Test class<br /> */</div>
|
||||
<div class="tx-indent"><span class="tx-keyword">static</span> <span class="tx-keyword">function</span> getTestClass() : <span class="tx-class">TestClass</span> = <span class="tx-instance">TestClassSingleton</span></div>
|
||||
<div> </div>
|
||||
<div><span class="tx-category">instances:</span> <a class="uwt-button" href="#"><i class="fa fa-plus"></i> <span class="uwt-title">add</span></a></div>
|
||||
<div class="tx-indent"><span class="tx-instance">TestOne, 2342$1</span></div>
|
||||
<div class="tx-indent"><span class="tx-instance">TestAnother, 2342$2</span></div>
|
||||
<div> </div>
|
||||
<div>}</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
webapp/images/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
56
webapp/images/favicon.svg
Normal file
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="256"
|
||||
height="256"
|
||||
viewBox="0 0 67.733332 67.733333"
|
||||
version="1.1"
|
||||
id="svg8765"
|
||||
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
|
||||
sodipodi:docname="favicon.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview8767"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.75722503"
|
||||
inkscape:cx="298.45818"
|
||||
inkscape:cy="-52.16415"
|
||||
inkscape:window-width="1452"
|
||||
inkscape:window-height="752"
|
||||
inkscape:window-x="468"
|
||||
inkscape:window-y="114"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="layer1" />
|
||||
<defs
|
||||
id="defs8762" />
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-26.315569,-242.3202)">
|
||||
<g
|
||||
id="g2037"
|
||||
transform="matrix(0.83252983,0,0,0.83252983,-70.141693,159.16821)">
|
||||
<path
|
||||
id="path1303"
|
||||
style="fill:#ffffa9;fill-opacity:1;stroke-width:0.274328"
|
||||
d="m 185.12881,140.22707 a 28.623218,27.935101 0 0 1 -28.62321,27.93511 28.623218,27.935101 0 0 1 -28.62322,-27.93511 28.623218,27.935101 0 0 1 28.62322,-27.93511 28.623218,27.935101 0 0 1 28.62321,27.93511 z m 6.63061,0.11739 a 35.036093,10.724597 0 0 1 -35.03609,10.7246 35.036093,10.724597 0 0 1 -35.0361,-10.7246 35.036093,10.724597 0 0 1 35.0361,-10.7246 35.036093,10.724597 0 0 1 35.03609,10.7246 z" />
|
||||
<path
|
||||
id="path665"
|
||||
style="fill:#000000;stroke-width:0.098451"
|
||||
d="m 154.42124,170.93595 c -4.66033,-0.44377 -8.09564,-1.39311 -11.71568,-3.23762 -4.49599,-2.29082 -8.45067,-5.76198 -11.18473,-9.81726 -1.80045,-2.67051 -2.88026,-4.86812 -3.84842,-7.83223 -0.49798,-1.52457 -0.53405,-1.59858 -0.77997,-1.59983 -0.14182,-7.4e-4 -0.63317,-0.0668 -1.09189,-0.14675 -2.07332,-0.36156 -3.89875,-1.52443 -5.08369,-3.23851 -0.98181,-1.42023 -1.39002,-2.73946 -1.39002,-4.49214 0,-1.74516 0.35688,-2.9192 1.33724,-4.39914 1.25544,-1.8952 3.22464,-3.07811 5.63975,-3.38784 l 0.88386,-0.11335 0.20473,-0.70165 c 0.39208,-1.34382 1.21136,-3.46681 1.82847,-4.73814 2.86127,-5.89455 7.28069,-10.47177 13.14009,-13.60925 4.06832,-2.17843 9.31932,-3.47162 14.09776,-3.47193 11.35816,-7.9e-4 21.57326,6.11154 26.90136,16.09667 0.68491,1.28355 1.42353,3.04524 1.9871,4.73945 l 0.56132,1.68746 0.8946,0.11387 c 2.72568,0.34695 4.93251,1.89382 6.11866,4.28884 0.59309,1.19757 0.83068,2.18575 0.83068,3.4551 0,2.2317 -0.72673,4.01372 -2.26438,5.55254 -1.32267,1.32367 -2.81162,2.05091 -4.66547,2.27874 l -0.93628,0.11506 -0.20421,0.6986 c -2.19845,7.521 -7.19736,13.89163 -13.9664,17.79887 -3.34122,1.92862 -7.25378,3.2414 -11.23974,3.77128 -1.15605,0.15368 -5.12511,0.27768 -6.05474,0.18916 z m 5.58191,-3.24262 c 5.13696,-0.67293 9.74997,-2.64904 13.86218,-5.93825 0.71963,-0.57561 1.74334,-1.5485 2.65392,-2.52218 3.11994,-3.33612 5.32158,-7.41967 6.50111,-12.05811 0.41981,-1.65086 0.60457,-1.78214 2.64768,-1.8812 0.9083,-0.044 1.59292,-0.12712 1.85645,-0.22526 1.80119,-0.67079 3.00118,-2.25388 3.14736,-4.15214 0.16874,-2.19134 -1.28856,-4.29085 -3.41042,-4.91335 -0.35064,-0.10287 -0.92685,-0.15762 -1.67367,-0.15904 -1.28723,-0.003 -1.801,-0.15865 -2.14087,-0.65091 -0.10716,-0.15522 -0.31897,-0.76955 -0.47069,-1.36518 -0.93093,-3.65479 -2.61026,-7.09995 -4.96691,-10.18969 -0.86542,-1.13462 -3.57618,-3.81925 -4.78389,-4.73777 -3.61706,-2.75093 -7.86973,-4.59034 -12.25716,-5.3016 -1.46351,-0.23725 -2.39619,-0.25195 -3.34353,-0.0527 -0.52946,0.11138 -0.74138,0.11991 -0.87682,0.0353 -0.1058,-0.0661 -0.32195,-0.0846 -0.53022,-0.0456 -0.26647,0.05 -0.37461,0.13193 -0.44658,0.33841 -0.0662,0.18981 -0.30025,0.38996 -0.77164,0.65983 -2.40801,1.37853 -3.82128,4.42258 -3.27607,7.05635 0.18325,0.88522 0.74837,1.93959 1.36137,2.53996 0.89092,0.87256 2.37931,1.47335 3.65009,1.47335 1.72235,0 3.56898,-1.05519 4.19336,-2.39615 0.27392,-0.5883 0.31813,-1.4897 0.0943,-1.92256 -0.20734,-0.40095 -0.78005,-0.86937 -1.20837,-0.98831 -0.49369,-0.13711 -0.60009,-0.13207 -1.14693,0.0543 -0.36203,0.12335 -0.55025,0.27326 -0.8464,0.67415 -0.75951,1.02811 -1.85247,1.13481 -2.59426,0.25325 -0.60032,-0.71344 -0.40421,-1.58866 0.59868,-2.6719 1.78142,-1.92414 5.04633,-1.94768 6.95527,-0.0501 2.15749,2.14462 1.97888,5.43986 -0.42454,7.83242 -1.49793,1.49116 -3.41953,2.27038 -5.59887,2.27038 -3.86797,0 -6.94427,-2.34775 -7.97089,-6.0832 -0.22546,-0.82035 -0.26242,-1.1447 -0.26035,-2.28514 0.002,-1.13287 0.0418,-1.47444 0.2694,-2.3136 0.32462,-1.19703 0.96374,-2.52744 1.64586,-3.42608 0.27948,-0.36819 0.48943,-0.68816 0.46656,-0.71103 -0.0496,-0.0496 -2.02844,0.45988 -2.93496,0.75561 -4.21339,1.37453 -8.14228,3.86587 -11.26056,7.14039 -3.12071,3.27707 -5.47739,7.57177 -6.60821,12.04251 -0.46756,1.84852 -0.63603,1.97735 -2.70751,2.07057 -1.63073,0.0734 -2.06799,0.2007 -3.04642,0.88704 -0.90616,0.63563 -1.63196,1.73811 -1.86389,2.83124 -0.48984,2.30862 0.74413,4.59316 2.94353,5.44956 0.41519,0.16166 0.87208,0.22679 1.9861,0.28309 2.08179,0.10521 2.21251,0.20387 2.67161,2.0164 1.33711,5.2789 3.98437,9.70182 8.08946,13.51549 4.3174,4.0109 10.00337,6.47089 16.19521,7.00674 1.33262,0.11532 4.20802,0.0411 5.63114,-0.14529 z m -4.49895,-8.96886 c -2.42739,-0.36849 -4.14474,-1.19398 -5.71126,-2.74526 -0.49213,-0.48733 -1.08361,-1.17403 -1.3144,-1.52599 -0.38719,-0.59045 -0.4169,-0.68192 -0.38429,-1.18297 0.0624,-0.95887 0.72431,-1.54197 1.64945,-1.45307 0.58903,0.0566 0.80472,0.22438 1.50628,1.17169 1.25397,1.69323 3.15789,2.66413 5.22748,2.66574 1.77279,0.002 3.2175,-0.5668 4.49792,-1.76893 0.41899,-0.39337 0.89794,-0.92738 1.06434,-1.18669 0.89534,-1.39527 2.79253,-1.08912 2.94282,0.47489 0.0544,0.56584 -0.14092,0.97684 -0.9418,1.98213 -1.73225,2.17437 -4.34556,3.47997 -7.15822,3.57624 -0.59563,0.0204 -1.21587,0.0169 -1.37832,-0.008 z m -9.42689,-16.3243 c -1.05796,-0.37755 -1.70743,-1.32919 -1.68468,-2.46849 0.0271,-1.35807 0.95868,-2.36264 2.30406,-2.48463 1.53463,-0.13916 2.77246,1.00107 2.77246,2.55387 0,1.72798 -1.76815,2.97869 -3.39184,2.39925 z m 19.272,0.0188 c -0.55571,-0.19973 -1.04356,-0.57612 -1.32793,-1.02452 -1.0593,-1.67034 -0.0679,-3.77259 1.86076,-3.94574 1.07173,-0.0962 1.95974,0.37504 2.49182,1.32239 0.92864,1.65341 -0.3592,3.79359 -2.26364,3.7618 -0.25611,-0.004 -0.59856,-0.0555 -0.76101,-0.11393 z" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.6 KiB |
54
webapp/images/icon.svg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
webapp/images/icons/128.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
webapp/images/icons/256.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
webapp/images/icons/32.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
webapp/images/icons/64.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
webapp/images/panel-background.png
Normal file
|
After Width: | Height: | Size: 192 KiB |
332
webapp/index.php
Normal file
@ -0,0 +1,332 @@
|
||||
<?php
|
||||
require("system.inc.php");
|
||||
require_once("mocha/system.inc.php");
|
||||
require_once("fx/system.inc.php");
|
||||
|
||||
require_once("bst/BSTApplication.inc.php");
|
||||
|
||||
use Mocha\Core\InstanceReference;
|
||||
|
||||
use Mocha\UI\DisplayOption;
|
||||
use Mocha\UI\ElementContent;
|
||||
|
||||
use MBS\Web\WebApplication;
|
||||
use MBS\Web\WebPage;
|
||||
|
||||
// valerie - schouvm / testing
|
||||
|
||||
$app = new BSTApplication(get_virtual_path_root(__FILE__));
|
||||
|
||||
//$wp = new WebPage("");
|
||||
//$wp->MasterPage = $mpDefault;
|
||||
|
||||
$app->Pages[] = new WebPage("", function()
|
||||
{
|
||||
$oms = getOMS();
|
||||
$tenant = $oms->getTenantInstance();
|
||||
|
||||
$current_user_title = WebApplication::$Current->Variables["current_user_title"];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title><?php echo($oms->getAttributeValue($tenant, $oms->getInstanceByGlobalIdentifier('9153A637992E4712ADF2B03F0D9EDEA6'))); ?></title>
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
<link rel="stylesheet" type="text/css" href="style/main.css?v=202310280055" />
|
||||
<link rel="shortcut icon" href="images/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="HandheldFriendly" content="true" />
|
||||
<script type="text/javascript" src="scripts/System.js"></script>
|
||||
<script type="text/javascript" src="scripts/bst.js"></script>
|
||||
<script type="text/javascript" src="scripts/controls/CheckBox.js"></script>
|
||||
</head>
|
||||
<body class="uwt-layout uwt-layout-box uwt-orientation-vertical">
|
||||
<div class="uwt-header uwt-layout uwt-layout-box uwt-orientation-horizontal">
|
||||
<label>Welcome, <?php echo($current_user_title); ?>!</label>
|
||||
<div class="uwt-pack-end">
|
||||
<a href="/bst"><i class="fa fa-refresh"></i><span class="uwt-title">Refresh</span></a>
|
||||
<a href="logout.php"><i class="fa fa-person-to-door"></i><span class="uwt-title">Log Out</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<form method="POST">
|
||||
<div class="uwt-layout uwt-layout-box uwt-orientation-horizontal">
|
||||
<?php
|
||||
$dt = new DateTimeImmutable();
|
||||
$dtend = $dt->add(new DateInterval("PT1H"));
|
||||
$current_user_id = WebApplication::$Current->Variables["current_user_id"];
|
||||
|
||||
if (user_has_permission($current_user_id, 3))
|
||||
{
|
||||
?>
|
||||
<div class="uwt-panel uwt-mobile-overlay" id="add_event_panel">
|
||||
<div class="uwt-content">
|
||||
<h1>Add a new event</h1>
|
||||
<p>
|
||||
Please specify where each kid is staying. If you will not need a babysitter, please select 'Home'.
|
||||
</p>
|
||||
<table class="uwt-formview">
|
||||
<?php
|
||||
// get the kids
|
||||
$kids = sqlexec("SELECT * FROM bst_kids");
|
||||
$locs = sqlexec("SELECT * FROM bst_locations");
|
||||
foreach ($kids as $kid)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo($kid["name"]); ?></td>
|
||||
<td>
|
||||
<select id="kid_<?php echo($kid["id"]); ?>_location" name="kid_<?php echo($kid["id"]); ?>_location"><?php
|
||||
foreach ($locs as $loc)
|
||||
{
|
||||
?><option value="<?php echo($loc["id"]); ?>"><?php echo($loc["name"]); ?></option><?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
Start moment:
|
||||
</td>
|
||||
<td>
|
||||
<input type="date" value="<?php echo ($dt->format("Y-m-d")); /*echo ($dt->format("l, F d Y")); */?>" />
|
||||
<input type="time" value="<?php echo ($dt->format("H:i:s")); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="end_moment_valid" type="checkbox" name="end_moment_valid" /><label style="vertical-align: middle" for="end_moment_valid">End moment:</label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="end_moment_date" name="end_moment_date" disabled="disabled" type="date" value="<?php echo ($dt->format("Y-m-d")); /*echo ($dt->format("l, F d Y")); */?>" />
|
||||
<input id="end_moment_time" name="end_moment_time" disabled="disabled" type="time" value="<?php echo ($dt->format("H:i:s")); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Event comment (optional):
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="comment" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="uwt-footer">
|
||||
<button class="uwt-button uwt-color-primary" name="submit_action" value="add_event">Add Event</button>
|
||||
<button id="add_event_cancel_mobile_button" class="uwt-button uwt-mobile-only">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
}
|
||||
if (user_has_permission($current_user_id, 2))
|
||||
{
|
||||
?>
|
||||
<div class="uwt-panel uwt-expand">
|
||||
<div class="uwt-content">
|
||||
<h1>Previous events</h1>
|
||||
<?php
|
||||
$__DO_Mobile_Hidden = new InstanceReference();
|
||||
$__DO_Mobile_Only = new InstanceReference();
|
||||
|
||||
$elements = array
|
||||
(
|
||||
new ElementContent("These are the events that are currently in progress. To end an event and calculate the final payment, click 'End Event Now'.",
|
||||
array($__DO_Mobile_Only)),
|
||||
new ElementContent("These are the events that are currently in progress. To view more details, tap on the event.",
|
||||
array($__DO_Mobile_Hidden))
|
||||
);
|
||||
|
||||
foreach ($elements as $elem)
|
||||
{
|
||||
$classList = "";
|
||||
$displayOptions = $elem->getDisplayOptions();
|
||||
if ($displayOptions !== null)
|
||||
{
|
||||
if ($displayOptions->contains($__DO_Mobile_Only))
|
||||
{
|
||||
$classList = "uwt-mobile-hidden";
|
||||
}
|
||||
else if ($displayOptions->contains($__DO_Mobile_Hidden))
|
||||
{
|
||||
$classList = "uwt-mobile-only";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<p class="<?php echo($classList); ?>">
|
||||
<?php
|
||||
echo($elem->getText());
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<ul class="uwt-mobile-only uwt-listbox"><?php
|
||||
$bses = sqlexec("SELECT *, TIMEDIFF(end_datetime, start_datetime) AS diff_datetime, TIMESTAMPDIFF(second, start_datetime, end_datetime) AS diff_timestamp FROM bst_events");
|
||||
if (count($bses) > 0)
|
||||
{
|
||||
foreach ($bses as $bs)
|
||||
{
|
||||
$event_id = $bs["id"];
|
||||
$start_datetime = $bs["start_datetime"];
|
||||
$end_datetime = $bs["end_datetime"];
|
||||
$diff_datetime = $bs["diff_datetime"];
|
||||
$diff_timestamp = $bs["diff_timestamp"];
|
||||
$comment = $bs["comment"];
|
||||
?>
|
||||
<li>
|
||||
<div class="uwt-title"><?php echo($comment);
|
||||
if ($end_datetime === null)
|
||||
{
|
||||
?><span style="font-weight: normal; padding-left: 32px; color: var(--uwt-color-warning);">In progress</span><?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?><span style="font-weight: normal; padding-left: 32px; color: var(--uwt-color-success);">Complete</span><?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="uwt-description">Emily, Christopher * Valerie and Rob</div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<li class="uwt-empty">(empty)</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<table class="uwt-listview uwt-mobile-hidden" style="width: 100%; margin-left: auto; margin-right: auto;" class="uwt-listview">
|
||||
<tr>
|
||||
<th rowspan="2">Comment</th>
|
||||
<th colspan="3">Kids</th>
|
||||
<th rowspan="2">Start</th>
|
||||
<th rowspan="2">End</th>
|
||||
<th rowspan="2">Time</th>
|
||||
<th rowspan="2">Total</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Location</th>
|
||||
<th>Rate</th>
|
||||
</tr>
|
||||
<?php
|
||||
// $bses = sqlexec("SELECT * FROM bst_kids_locations WHERE start_datetime <= NOW() AND (end_datetime IS NULL OR end_datetime >= NOW())");
|
||||
if (count($bses) > 0)
|
||||
{
|
||||
foreach ($bses as $bs)
|
||||
{
|
||||
$event_id = $bs["id"];
|
||||
$start_datetime = $bs["start_datetime"];
|
||||
$end_datetime = $bs["end_datetime"];
|
||||
$diff_datetime = $bs["diff_datetime"];
|
||||
$diff_timestamp = $bs["diff_timestamp"];
|
||||
$comment = $bs["comment"];
|
||||
|
||||
$bs_kids = sqlexec("SELECT * FROM bst_event_kids WHERE event_id = :event_id", array( "event_id" => $event_id));
|
||||
|
||||
$rowspan = count($bs_kids);
|
||||
if ($rowspan == 0)
|
||||
{
|
||||
$rowspan = 1;
|
||||
}
|
||||
|
||||
echo("<tr><td rowspan=\"" . $rowspan . "\">");
|
||||
echo($comment);
|
||||
echo("</td>");
|
||||
|
||||
$first = true;
|
||||
$total_cost = 0;
|
||||
$all_kids_rate = 0;
|
||||
foreach ($bs_kids as $bs_kid)
|
||||
{
|
||||
$rate = get_kid_rate($bs_kid["kid_id"]);
|
||||
$all_kids_rate += $rate;
|
||||
}
|
||||
foreach ($bs_kids as $bs_kid)
|
||||
{
|
||||
$rate = get_kid_rate($bs_kid["kid_id"]);
|
||||
echo("<td>" . get_kid_name($bs_kid["kid_id"]) . "</td>");
|
||||
echo("<td>" . get_location_name($bs_kid["location_id"]) . "</td>");
|
||||
echo("<td>" . $rate . "</td>");
|
||||
|
||||
$hour_rate = round(($diff_timestamp / 60) / 60, 2);
|
||||
$total_cost = round($all_kids_rate * $hour_rate, 2);
|
||||
|
||||
if ($first)
|
||||
{
|
||||
echo("<td rowspan=\"" . $rowspan . "\">" . $start_datetime . "</td>");
|
||||
echo("<td rowspan=\"" . $rowspan . "\">");
|
||||
if ($end_datetime === null)
|
||||
{
|
||||
echo("<button class=\"uwt-button uwt-color-primary\" name=\"end_event\" value=\"" . $event_id . "\">End Event Now</button>");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo($end_datetime);
|
||||
}
|
||||
echo("</td>");
|
||||
echo("<td rowspan=\"" . $rowspan . "\">" . $diff_datetime . " <!-- " . $hour_rate . " hours --></td>");
|
||||
echo("<td rowspan=\"" . $rowspan . "\">\$" . $total_cost . "</td>");
|
||||
$first = false;
|
||||
}
|
||||
|
||||
echo("</tr>");
|
||||
}
|
||||
|
||||
if ($first)
|
||||
{
|
||||
echo("<td rowspan=\"" . $rowspan . "\"></td>");
|
||||
echo("<td rowspan=\"" . $rowspan . "\"></td>");
|
||||
echo("<td rowspan=\"" . $rowspan . "\"></td>");
|
||||
echo("<td rowspan=\"" . $rowspan . "\">" . $start_datetime . "</td>");
|
||||
echo("<td rowspan=\"" . $rowspan . "\">" . $end_datetime . "</td>");
|
||||
echo("<td rowspan=\"" . $rowspan . "\">" . $diff_datetime . " <!-- " . $hour_rate . " hours --></td>");
|
||||
echo("<td rowspan=\"" . $rowspan . "\">\$" . $total_cost . "</td>");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="8">No data available</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uwt-mobile-only uwt-button-container">
|
||||
<a class="uwt-button uwt-button-round uwt-color-primary" href="#" id="add_event_mobile_button">
|
||||
<i class="fa fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
<div style="text-align: center; color: #aaaaaa; font-size: 10pt; padding-top: 64px;">
|
||||
<div style="margin-bottom: 8px;">Version <?php echo(get_version()); ?></div>
|
||||
<div>Powered by Mocha © MBS Business Solutions</div>
|
||||
<div class="uwt-badge uwt-color-purple" style="margin-top: 16px;">QA Preview</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
});
|
||||
$app->Start();
|
||||
?>
|
||||
226
webapp/login.php
Normal file
@ -0,0 +1,226 @@
|
||||
<?php
|
||||
require ("system.inc.php");
|
||||
require_once("mocha/system.inc.php");
|
||||
require_once("fx/system.inc.php");
|
||||
|
||||
use Mocha\Core\InstanceKey;
|
||||
use Mocha\Core\InstanceReference;
|
||||
|
||||
use Mocha\Core\KnownInstanceGuids;
|
||||
use Mocha\Core\KnownRelationshipGuids;
|
||||
|
||||
use Mocha\Oms\Oms;
|
||||
|
||||
function _IsPostback()
|
||||
{
|
||||
// thanks https://stackoverflow.com/questions/4242035
|
||||
return strtoupper($_SERVER['REQUEST_METHOD']) === 'POST';
|
||||
//&& (basename($_SERVER['HTTP_REFERER']) == $_SERVER['SCRIPT_NAME']));
|
||||
}
|
||||
|
||||
function get_ec_value(InstanceKey $ecid)
|
||||
{
|
||||
$fieldName = "ec__" . $ecid;
|
||||
if (isset($_POST[$fieldName]))
|
||||
{
|
||||
return $_POST[$fieldName];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
$oms = getOMS();
|
||||
$tenant = $oms->getTenantInstance();
|
||||
|
||||
|
||||
if (_IsPostback())
|
||||
{
|
||||
if ($_GET["do_pw"] == "1")
|
||||
{
|
||||
$password = $_POST["password"];
|
||||
$password_salt = generateRandomString(32);
|
||||
$password_hash = hash("sha512", $password . $password_salt);
|
||||
echo($password_hash);
|
||||
echo ("<br />");
|
||||
echo($password_salt);
|
||||
return;
|
||||
}
|
||||
|
||||
$username = get_ec_value(new InstanceKey(56, 1));
|
||||
$password = get_ec_value(new InstanceKey(56, 2));
|
||||
|
||||
$pdo = getPDO();
|
||||
$query = "SELECT * FROM bst_users WHERE username = :username";
|
||||
$statement = $pdo->prepare($query);
|
||||
|
||||
$statement->execute(array(
|
||||
"username" => $username
|
||||
));
|
||||
|
||||
$results = $statement->fetchAll();
|
||||
|
||||
if (count($results) > 0)
|
||||
{
|
||||
$result = $results[0];
|
||||
|
||||
$password_hash = $result["password_hash"];
|
||||
$password_salt = $result["password_salt"];
|
||||
|
||||
$expected_hash = hash("sha512", $password . $password_salt);
|
||||
if ($expected_hash == $password_hash)
|
||||
{
|
||||
$error_message = "";
|
||||
|
||||
$user_id = $result["id"];
|
||||
$ip_address = $_SERVER["REMOTE_ADDR"];
|
||||
|
||||
$session_tag = generateRandomString(32);
|
||||
$_SESSION["user_token"] = $session_tag;
|
||||
|
||||
$statement = $pdo->prepare("INSERT INTO bst_sessions (session_tag, user_id, start_datetime, ip_address) VALUES (:session_tag, :user_id, NOW(), :ip_address)");
|
||||
$statement->execute(array("session_tag" => $session_tag, "user_id" => $user_id, "ip_address" => $ip_address));
|
||||
|
||||
if (isset($_SESSION["LoginRedirectURL"]))
|
||||
{
|
||||
header("Location: /" . $_SESSION["LoginRedirectURL"]);
|
||||
unset($_SESSION["LoginRedirectURL"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
header("Location: /bst/");
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$error_message = "The user name or password you entered is incorrect. ( " . $password_hash . " ; " . $password_salt . " ; " . $expected_hash . " )";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error_message = "The user name or password you entered is incorrect.";
|
||||
}
|
||||
}
|
||||
|
||||
function renderElementSingularVertically(Oms $oms, InstanceReference $element)
|
||||
{
|
||||
?>
|
||||
<table class="mcx-element uwt-formview uwt-expand" data-instance-id="<?php echo($element->InstanceKey); ?>"><?php
|
||||
$elementContents = $oms->getRelatedInstances($element, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content));
|
||||
foreach ($elementContents as $elementContent)
|
||||
{
|
||||
?>
|
||||
<tr data-instance-id="<?php echo($elementContent->InstanceKey); ?>">
|
||||
<td><label for="ec__<?php echo($elementContent->InstanceKey); ?>"><?php echo($oms->getInstanceText($elementContent)); ?></label></td>
|
||||
<td><?php
|
||||
|
||||
$obscuredText = false;
|
||||
$elementContentDisplayOptions = $oms->getRelatedInstances($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option));
|
||||
if ($elementContentDisplayOptions !== null)
|
||||
{
|
||||
foreach ($elementContentDisplayOptions as $displayOption)
|
||||
{
|
||||
if ($displayOption->GlobalIdentifier == KnownInstanceGuids::DisplayOption__ObscuredText)
|
||||
{
|
||||
$obscuredText = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($obscuredText)
|
||||
{
|
||||
?><input type="password" name="ec__<?php echo($elementContent->InstanceKey); ?>" id="ec__<?php echo($elementContent->InstanceKey); ?>" value="" /><?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?><input type="text" name="ec__<?php echo($elementContent->InstanceKey); ?>" id="ec__<?php echo($elementContent->InstanceKey); ?>" value="" /><?php
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
/*
|
||||
<tr data-instance-id="56$2">
|
||||
<td><label for="password">Password:</label></td>
|
||||
<td><input type="password" name="ec__56$2" id="ec__56$2" value="" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($error_message !== "")
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2" style="color: #ff0000;">
|
||||
<?php
|
||||
echo($error_message);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
*/?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title><?php echo($oms->getAttributeValue($tenant, $oms->getInstanceByGlobalIdentifier('9153A637992E4712ADF2B03F0D9EDEA6'))); ?></title>
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
<link rel="stylesheet" type="text/css" href="style/main.css?v=202310280055" />
|
||||
<link rel="shortcut icon" href="images/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body class="login-page">
|
||||
<?php
|
||||
|
||||
?>
|
||||
<form method="POST">
|
||||
<div class="login-container">
|
||||
<div class="uwt-content">
|
||||
<div class="uwt-layout uwt-layout-box uwt-orientation-horizontal uwt-mobile-orientation-vertical">
|
||||
<div class="uwt-expand" style="padding-left: 16px; padding-right: 16px;">
|
||||
<div class="uwt-layout uwt-layout-box uwt-orientation-horizontal">
|
||||
<img class="header-image" src="images/icon.svg" />
|
||||
<div>
|
||||
<h1 style="vertical-align: middle; padding: 16px;">Welcome to BST</h1>
|
||||
</div>
|
||||
</div>
|
||||
<p>Enter your user name and password to continue. If you do not know this information, contact your system administrator.</p>
|
||||
</div>
|
||||
<div class="uwt-expand uwt-panel">
|
||||
<div class="uwt-content">
|
||||
<?php
|
||||
$instElement = $oms->getInstanceByGlobalIdentifier("2b7d4481b7c24e26a917e3ff7c367a8a");
|
||||
if ($instElement !== null)
|
||||
{
|
||||
renderElementSingularVertically($oms, $instElement);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("Error Element is Null");
|
||||
}
|
||||
?>
|
||||
<input style="display: block; width: 100%; padding: 16px; font-size: 1.2em;" class="uwt-button uwt-color-primary" type="submit" value="Log In" />
|
||||
</div>
|
||||
<!--
|
||||
<div class="uwt-footer">
|
||||
<input class="uwt-button uwt-color-primary" type="submit" value="Log In" />
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; color: #aaaaaa; font-size: 10pt; padding-top: 64px;">
|
||||
<div style="margin-bottom: 8px;">Version <?php echo(get_version()); ?></div>
|
||||
<div>Powered by Mocha © MBS Business Solutions</div>
|
||||
<div class="uwt-badge uwt-color-purple" style="margin-top: 16px;">QA Preview</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
7
webapp/logout.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
session_start();
|
||||
$_SESSION["user_token"] = null;
|
||||
|
||||
header ("Location: index.php");
|
||||
return;
|
||||
?>
|
||||
28
webapp/manifest.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "BST",
|
||||
"icons":
|
||||
[
|
||||
{
|
||||
"src": "images/icons/256.png",
|
||||
"type": "image/png",
|
||||
"sizes": "256x256"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/128.png",
|
||||
"type": "image/png",
|
||||
"sizes": "128x128"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/64.png",
|
||||
"type": "image/png",
|
||||
"sizes": "64x64"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/32.png",
|
||||
"type": "image/png",
|
||||
"sizes": "32x32"
|
||||
}
|
||||
],
|
||||
"start_url": "https://secure.azcona-becker.com/bst",
|
||||
"display": "standalone"
|
||||
}
|
||||
10
webapp/masterPages/DefaultMasterPage.inc.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
require_once("../system.inc.php");
|
||||
|
||||
use \MBS\Web\WebPage;
|
||||
|
||||
class DefaultMasterPage extends WebPage
|
||||
{
|
||||
|
||||
}
|
||||
?>
|
||||
5
webapp/mocha/.htaccess
Normal file
@ -0,0 +1,5 @@
|
||||
RewriteEngine on
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.+) index.php?vp=$1 [PT,L,QSA]
|
||||
3
webapp/mocha/config.inc.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
?>
|
||||
19
webapp/mocha/core/InstanceKey.inc.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace Mocha\Core;
|
||||
|
||||
class InstanceKey
|
||||
{
|
||||
public $ClassIndex;
|
||||
public $InstanceIndex;
|
||||
|
||||
public function __construct($class_id, $inst_id)
|
||||
{
|
||||
$this->ClassIndex = $class_id;
|
||||
$this->InstanceIndex = $inst_id;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->ClassIndex . "$" . $this->InstanceIndex;
|
||||
}
|
||||
}
|
||||
10
webapp/mocha/core/InstanceReference.inc.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Mocha\Core;
|
||||
|
||||
class InstanceReference
|
||||
{
|
||||
public $DatabaseId;
|
||||
public $InstanceKey;
|
||||
public $GlobalIdentifier;
|
||||
}
|
||||
?>
|
||||
31
webapp/mocha/core/InstanceSet.inc.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace Mocha\Core;
|
||||
class InstanceSet
|
||||
{
|
||||
|
||||
private $_Instances;
|
||||
public function __construct()
|
||||
{
|
||||
$this->_Instances = array();
|
||||
}
|
||||
|
||||
public function add($inst)
|
||||
{
|
||||
$this->_Instances[] = $inst;
|
||||
}
|
||||
public function contains($inst)
|
||||
{
|
||||
foreach ($this->_Instances as $needle)
|
||||
{
|
||||
if ($needle === $inst)
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
if (in_array($inst, $this->_Instances))
|
||||
trigger_error("needle is equal to inst");
|
||||
return true;
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
28
webapp/mocha/core/KnownAttributeGuids.inc.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace Mocha\Core;
|
||||
// generated from Mocha.System, v4.0.2023.10r302009
|
||||
class KnownAttributeGuids
|
||||
{
|
||||
// Text
|
||||
const Name = "9153A637992E4712ADF2B03F0D9EDEA6";
|
||||
const Verb = "61345a5d33974a9687978863f03a476c";
|
||||
const Value = "041DD7FD2D9C412B8B9DD7125C166FE0";
|
||||
const CSSValue = "C0DD4A42F5034EB380347C428B1B8803";
|
||||
const RelationshipType = "71106B1219344834B0F6D894637BAEED";
|
||||
|
||||
const TargetURL = "970F79A09EFE4E7D92869908C6F06A67";
|
||||
|
||||
const UserName = "960FAF025C5940F791A720012A99D9ED";
|
||||
const PasswordHash = "F377FC294DF14AFB96434191F37A00A9";
|
||||
const PasswordSalt = "8C5A99BC40ED4FA2B23FF373C1F3F4BE";
|
||||
|
||||
const ContentType = "34142FCB172C490AAF03FF8451D00CAF";
|
||||
|
||||
const BackgroundColor = "B817BE3BD0AC4A60A98A97F99E96CC89";
|
||||
const ForegroundColor = "BB4B6E0DD9BA403D9E8193E8F7FB31C8";
|
||||
const IPAddress = "ADE5A3C3A84E4798BC5BE08F21380208";
|
||||
const Token = "da7686b638034f1597f67f8f3ae16668";
|
||||
|
||||
const DebugDefinitionFileName = "03bf47c7dc9743c8a8c9c6147bee4e1f";
|
||||
}
|
||||
?>
|
||||
127
webapp/mocha/core/KnownClassGuids.inc.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
namespace Mocha\Core;
|
||||
class KnownClassGuids
|
||||
{
|
||||
const Clasz = "B9C9B9B7AD8A4CBDAA6BE05784630B6B";
|
||||
const Attribute = "F9CD7751EF624F7C8A28EBE90B8F46AA";
|
||||
const Relationship = "9B0A80F9C3254D36997CFB4106204648";
|
||||
|
||||
const InstanceDefinition = "ee26f1460b894cfea1afae6ac3533eae";
|
||||
|
||||
const Enumeration = "70c3ee174d5443429e7b527cf73c93dd";
|
||||
|
||||
// Attribute subclasses
|
||||
const TextAttribute = "C2F3654260C34B9E9A96CA9B309C43AF";
|
||||
const BooleanAttribute = "EA830448A4034ED9A3D3048D5D5C3A03";
|
||||
const NumericAttribute = "9DE86AF1EFD64B719DCC202F247C94CB";
|
||||
const DateAttribute = "0B7B1812DFB44F25BF6DCEB0E1DF8744";
|
||||
|
||||
const Element = "919295953dbd4eae8add6120a49797c7";
|
||||
const ElementContent = "f85d4f5ec69f449899137a8554e233a4";
|
||||
|
||||
const Translation = "04A53CC832064A9799C5464DB8CAA6E6";
|
||||
const TranslationValue = "6D38E757EC1843AD9C35D15BB446C0E1";
|
||||
|
||||
const String = "5AECB489DBC2432E86AF6BE349317238";
|
||||
const StringComponent = "F9E2B67113F54172A568725ACD8BBFAB";
|
||||
const ExtractSingleInstanceStringComponent = "FCECCE4E8D05485AAE34B1B45E766661";
|
||||
const InstanceAttributeStringComponent = "623565D55AEE49EDA5A90CFE670507BC";
|
||||
|
||||
const Prompt = "EC889225416A4F73B8D12A42B37AF43E";
|
||||
const TextPrompt = "195DDDD70B744498BF61B0549FE05CF3";
|
||||
const ChoicePrompt = "5597AEEB922D48AFAE67DF7D951C71DB";
|
||||
const InstancePrompt = "F3ECBF1EE7324370BE058FA7CC520F50";
|
||||
const BooleanPrompt = "a7b49c03c9ce4a79a4b2e94fc8cd8b29";
|
||||
|
||||
const Method = "D281391380B64DD69AD656D989169734";
|
||||
|
||||
// const MethodCall = "084A6D5832C94A5F9D2B86C46F74E522";
|
||||
|
||||
const ConditionalEvaluationCase = "ba18abdc11ae46af850aeb30280b0ffa";
|
||||
const ConditionalSelectAttributeCase = "a1115690c4004e3e9c8f24e2a9477e8f";
|
||||
|
||||
const AccessModifier = "ca4fcc1116c84872a71282e589d382ce";
|
||||
|
||||
const MethodBinding = "CB36098EB9BF4D2287FA4186EC632C89";
|
||||
const ReturnAttributeMethodBinding = "30FB6BA62BBB41D2B91A709C00A07790";
|
||||
const ReturnInstanceSetMethodBinding = "AADC20F97559429BAEF097E059295C76";
|
||||
|
||||
const Executable = "6A1F66F78EA643D1B2AF198F63B84710";
|
||||
const ExecutableReturningAttribute = "50b2db7a36234be4b40d98fab89d3ff5";
|
||||
const ExecutableReturningInstanceSet = "d5fbc5cb13fb4e68b3ad46b4ab8909f7";
|
||||
const ExecutableReturningElement = "a15a4f521f1a4ef380a7033d45cc0548";
|
||||
const ExecutableReturningWorkData = "a0365b76ad1f462e84dad6a1d5b9c88c";
|
||||
|
||||
const Event = "ca727ecd85364aeb9e75352dbb958767";
|
||||
|
||||
const WorkData = "05e8f02388cb416b913e75299e665eb2";
|
||||
const WorkSet = "c4c171d8994b485bb0ac053d11b963ab";
|
||||
|
||||
const Parameter = "1ab99be043f1495ab85eec38ea606713";
|
||||
const ParameterAssignment = "c7aa0c7c50d844fd9b05a558a38a6954"; // 28
|
||||
const ElementContentDisplayOption = "bd68052adaa443b98965d38095473170";
|
||||
|
||||
const ReportObject = "ff7d5757d9d948abab045932e7341a90";
|
||||
|
||||
const Validation = "3E45AA176E8E41DB9C94E84B4B4176E8";
|
||||
const ValidationClassification = "8f43d578a671436bafdcc8689a5bd9b6";
|
||||
|
||||
const PrimaryObjectReportField = "59EA0C72480048BA84A4DDFE10E5F4D0";
|
||||
const RelationshipReportField = "FC4E3BB51EA744FFB8282EA54CDD4ABB";
|
||||
|
||||
const ReportField = "655A04D9FE354F899AABB8FA34989D03";
|
||||
const AttributeReportField = "C06E0461A95645999708012C8FE04D94";
|
||||
|
||||
const Module = "e009631d6b9d445c95df79f4ef8c8fff";
|
||||
|
||||
const Report = "19D947B6CE824EEE92ECA4E01E27F2DB";
|
||||
const ReportColumn = "BEFE99A1B2EB4365A2C9061C6609037B";
|
||||
const StandardReport = "FDF4A498DE83417DBA01707372125C8D";
|
||||
|
||||
const TaskCategory = "e8d8060fa20c442f838403488b63247f";
|
||||
const Task = "D4F2564B2D114A5C8AA9AF52D4EACC13";
|
||||
const UITask = "BFD07772178C4885A6CEC85076C8461C";
|
||||
|
||||
const Tenant = "703F9D65C5844D9FA656D0E3C247FF1F";
|
||||
|
||||
const User = "9C6871C19A7F4A3A900E69D1D9E24486";
|
||||
const UserLogin = "64F4BCDB38D04373BA308AE99AF1A5F7";
|
||||
|
||||
const MenuItemCommand = "9D3EDE236DB946649145ABCBD3A0A2C2";
|
||||
const MenuItemSeparator = "798DECAB511949D7B0ADD4BF45807188";
|
||||
const MenuItemHeader = "1F1488738A974409A79BC19D5D380CA4";
|
||||
const MenuItemInstance = "6E3AA9AF96B94208BEA9291A72C68418";
|
||||
|
||||
const Style = "A48C843AB24B4BC3BE6FE2D069229B0A";
|
||||
const StyleRule = "C269A1F3E0144230B78D38EAF6EA8A81";
|
||||
const StyleClass = "a725f08977634887af37da52358c378c";
|
||||
|
||||
const Page = "D962635948E34840A089CD8DA6731690";
|
||||
const ContainerPageComponent = "6AD6BD1C7D1C4AC99642FEBC61E9D6FF";
|
||||
const ButtonPageComponent = "F480787DF51E498A897272128D808AEB";
|
||||
const HeadingPageComponent = "FD86551EE4CE4B8B95CBBEC1E6A0EE2B";
|
||||
const ImagePageComponent = "798B67FAD4BE42B9B4BD6F8E02C953C0";
|
||||
const PanelPageComponent = "D349C48996844A5A9843B906A7F803BC";
|
||||
const ParagraphPageComponent = "ADFF93CE9E854168A7D45239B99BE36D";
|
||||
const SequentialContainerPageComponent = "A66D9AE23BEC4083A5CB7DE3B03A9CC7";
|
||||
const SummaryPageComponent = "5EBA7BD6BA0A45B2835CC92489FD7E74";
|
||||
const TabContainerPageComponent = "E52B02D7895C46429B03EB0232868190";
|
||||
const DetailPageComponent = "41F9508E6CF04F3D8762FF17CD52C466";
|
||||
const ElementPageComponent = "122d55659df94656b6afba5df6630d32";
|
||||
|
||||
const IntegrationID = "49a5ebdabaaa4edebba5decc250ce1a3";
|
||||
const IntegrationIDUsage = "86084b9f38604857a41f2f8b6877aff1";
|
||||
|
||||
const Dashboard = "896B529C452D42AC98C5170ED4F826C6";
|
||||
const DashboardContent = "2720ea77cb0940999f74ccdacdd146e8";
|
||||
const Instance = "263C4882945F4DE9AED8E0D6516D4903";
|
||||
const InstanceSet = "53aac86ece604509a869417c38c305e0";
|
||||
|
||||
const AuditLine = "a4124a7602f6406a9583a197675b493b";
|
||||
|
||||
const Theme = "7c2cc4b583234478863b1759d7adf62e";
|
||||
|
||||
const CommonBoolean = "5b025da3b7bd45a9b08448c4a922bf72";
|
||||
const CommonInstanceSet = "3382da214fc545dcbbd1f7ba3ece1a1b";
|
||||
}
|
||||
?>
|
||||
29
webapp/mocha/core/KnownInstanceGuids.inc.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace Mocha\Core;
|
||||
|
||||
class KnownInstanceGuids
|
||||
{
|
||||
/**
|
||||
* The GUID of the default tenant instance.
|
||||
*/
|
||||
const DefaultTenant = "F2C9D4A99EFB426384DB66A9DA65AD00";
|
||||
|
||||
|
||||
const DisplayOption__DisplayAsPageTitle = "369335cf4a3d4349930062bd72dafeb6";
|
||||
const DisplayOption__NotEnterable = "831e921b51324b379303da0994a0f828";
|
||||
const DisplayOption__SubmitNotEnterable = "f480a1d6cc9b4606bce1d6757fa99bad";
|
||||
const DisplayOption__ShowSubelementsVertically = "8bfd1ae21474413db4dd6cd4993080d1";
|
||||
const DisplayOption__Singular = "683b3cdb2e69468ebb364bd62716542c";
|
||||
const DisplayOption__DoNotShow = "cc278872445449fe821aae657bffe062";
|
||||
const DisplayOption__InitializeForEntry = "59410ca482144b59ba491565d0cf16c7";
|
||||
const DisplayOption__DoNotShowLabel = "a9fe1e0207854363b4dd8b7ca989d4fd";
|
||||
const DisplayOption__WideText = "dc0570c5cfd54f879ba751fab4ccf551";
|
||||
const DisplayOption__Required = "7e508c5405074ae78ea27c9f197051c7";
|
||||
const DisplayOption__DoNotShowIfEmpty = "055b9a42caf542adbd2e9a4c3527947d";
|
||||
/// <summary>
|
||||
/// Obscured Text - displays text in a text box element as obscured (system-dependent, e.g. asterisk (*) or dot)
|
||||
/// </summary>
|
||||
/// <value>The GUID of the `Obscured Text` EC Display Option.</value>
|
||||
const DisplayOption__ObscuredText = "e42fb627655942e7a8fe59c9d674eec4";
|
||||
}
|
||||
?>
|
||||
263
webapp/mocha/core/KnownRelationshipGuids.inc.php
Normal file
@ -0,0 +1,263 @@
|
||||
<?php
|
||||
namespace Mocha\Core;
|
||||
class KnownRelationshipGuids
|
||||
{
|
||||
const Class__has_super__Class = "100F0308855D4EC599FAD8976CA20053";
|
||||
const Class__has_sub__Class = "C14BC80D879C4E6F9123E8DFB13F4666";
|
||||
|
||||
const Class__has__Method = "2DA282715E464472A6F5910B5DD6F608";
|
||||
const Method__for__Class = "76D2CE0DAA4D460BB8442BD76EF9902B";
|
||||
|
||||
const Class__has__Instance = "7EB41D3C2AE9488483A4E59441BCAEFB";
|
||||
const Instance__for__Class = "494D5A6D04BE477B8763E3F57D0DD8C8";
|
||||
|
||||
const Class__has__Relationship = "3997CAAD3BFA4EA69CFA2AA63E20F08D";
|
||||
const Relationship__for__Class = "C00BD63F10DA4751B8EA0905436EA098";
|
||||
|
||||
const Class__has_title__Translation = "B8BDB90569DD49CDB5570781F7EF2C50";
|
||||
|
||||
const Class__has__Attribute = "DECBB61A2C6C4BC890420B5B701E08DE";
|
||||
const Attribute__for__Class = "FFC8E435B9F844958C854DDA67F7E2A8";
|
||||
|
||||
const Class__has_default__Task = "CF396DAA75EA41488468C66A71F2262D";
|
||||
|
||||
const Class__has_owner__User = "D1A25625C90F4A73A6F2AFB530687705";
|
||||
const User__owner_for__Class = "04DD2E6BEA5748408DD5F0AA943C37BB";
|
||||
|
||||
const Instance__for__Module = "c60fda3c2c0a422980e8f644e4471d28";
|
||||
const Module__has__Instance = "c3e5d7e35e114f8da212b175327b2648";
|
||||
|
||||
const Class__has__Object_Source = "B62F9B81799B4ABEA4AF29B45347DE54";
|
||||
const Object_Source__for__Class = "FBB9391DC4A243269F857801F377253C";
|
||||
|
||||
const Relationship__has_source__Class = "7FB5D234042E45CBB11DAD72F8D45BD3";
|
||||
const Relationship__has_destination__Class = "F220F1C204994E87A32EBDBF80C1F8A4";
|
||||
const Relationship__has_sibling__Relationship = "656110FF450248B8A7F3D07F017AEA3F";
|
||||
|
||||
const Translation__has__Translation_Value = "F9B60C00FF1D438FAC746EDFA8DD7324";
|
||||
const Translation_Value__has__Language = "3655AEC2E2C94DDE8D980C4D3CE1E569";
|
||||
|
||||
const String__has__String_Component = "3B6C4C25B7BC42428ED1BA6D01B834BA";
|
||||
const Extract_Single_Instance_String_Component__has__Relationship = "5E499753F50F4A9EBF53DC013820499C";
|
||||
const Instance_Attribute_String_Component__has__Attribute = "E15D427769FB4F1992DB8D087F361484";
|
||||
const String_Component__has_source__Method = "1ef1c965e12048beb682aa040573b5fb";
|
||||
|
||||
const Class__instance_labeled_by__String = "F52FC851D65548A9B526C5FE0D7A29D2";
|
||||
const Class__has_summary__Report_Field = "D11050AD73764AB784DEE8D0336B74D2";
|
||||
const Class__has_related__Task = "4D8670E12AF14E7C9C87C910BD7B319B";
|
||||
|
||||
const Report_Object__has__Report_Field = "0af6265642bc40a5b0bcdbba67c347f6";
|
||||
const Report_Field__for__Report_Object = "b46c8caa3f46465fba117d6f385425a2";
|
||||
|
||||
const Task__has_title__Translation = "D97AE03C261F4060A06D985E26FA662C";
|
||||
const Task__has_instructions__Translation = "A93878989DC0400694F11FB02EB3ECD7";
|
||||
const Task__has__Prompt = "929B106F7E3E4D30BB84E450A4FED063";
|
||||
const Task__has__Task_Category = "84048159430d4f6c9361115c8629c517";
|
||||
const Task__executes__Method_Call = "D8C0D4D4F8C64B92A2C18BF16B16203D";
|
||||
const Task__has_preview_action_title__Translation = "3f65ce0211dd4829a46bb9ea1b43e56a";
|
||||
|
||||
const Prompt__has__Report_Field = "922CCB0561EA441D96E063D58231D202"; // 3de784b9456142f0946fb1e90d80029e
|
||||
const Report_Field__for__Prompt = "5DED3DB4686445A9A5FF8E5A35AD6E6F"; // b5f59216a1f149798642a4845e59daa8
|
||||
|
||||
const Instance_Prompt__has_valid__Class = "D5BD754BF4014FD8A70782684E7E25F0";
|
||||
|
||||
const Instance_Prompt_Value__has__Instance = "512B518EA89244ABAC354E9DBCABFF0B";
|
||||
|
||||
const Method__has__Method_Binding = "D52500F114214B739987223163BC9C04";
|
||||
const Method_Binding__for__Method = "B782A5928AF542288296E3D0B24C70A8";
|
||||
|
||||
const Method__has_return_type__Class = "1241c599e55d4dcf9200d0e48c217ef8";
|
||||
|
||||
const Method_Binding__has__Parameter_Assignment = "2493810994f1463a9314c49e667cf45b";
|
||||
const Parameter_Assignment__for__Method_Binding = "19c4a5dbfd2644b8b431e081e6ffff8a";
|
||||
|
||||
const Parameter__has_data_type__Instance = "ccb5200c5faf4a3a9e8e2edf5c2e0785";
|
||||
const Instance__data_type_for__Parameter = "ea1e6305b2e44ba591b41ecfbebfa490";
|
||||
|
||||
const Instance_Set__has__Instance = "7c9010a269f1402999c872e05c78c41e";
|
||||
|
||||
const Parameter_Assignment__assigns_to__Parameter = "a6d30e787bff4fccb109ee96681b0a9e";
|
||||
const Parameter__assigned_from__Parameter_Assignment = "2085341e5e7e4a7fbb8ddfa58f6030d9";
|
||||
|
||||
const Method_Binding__assigned_to__Parameter_Assignment = "cbcb23b710c449eba1cab9da73fe8b83";
|
||||
const Parameter_Assignment__assigns_from__Method_Binding = "1e055d30a96849d893fe541994fc0c51";
|
||||
|
||||
const Method_Call__has__Method = "3D3B601B4EF049F3AF0586CEA0F00619";
|
||||
const Method_Call__has__Prompt_Value = "765BD0C9117D4D0E88C92CEBD4898135";
|
||||
|
||||
const Validation__has__Validation_Classification = "BCDB6FFDD2F24B63BD7E9C2CCD9547E0";
|
||||
const Validation__has_true_condition__Executable = "AA2D3B5141534599A9836B4A13ADCBCB";
|
||||
const Validation__has_false_condition__Executable = "419047F8852B4A4DB161A8BD022FD8EB";
|
||||
|
||||
const Validation__has_failure_message__Translation = "E15A97DD2A1D4DC0BD6BA957B63D9802";
|
||||
const Translation__failure_message_for__Validation = "46a7dfcb884847d59ad3d27fbd8b423f";
|
||||
|
||||
const Get_Attribute_Method__has__Attribute = "5eca9b3fbe754f6e8495781480774833";
|
||||
|
||||
const Get_Referenced_Instance_Set_Method__loop_on__Instance_Set = "2978238f7cb04ba38c6f473df782cfef";
|
||||
const Get_Referenced_Instance_Set_Method__has_relationship__Method = "6a65819ec8cb45759af8ee221364049b";
|
||||
|
||||
const Get_Referenced_Attribute_Method__has__Attribute = "87f90fe95ec64b098f51b8a4d1544cae";
|
||||
const Get_Referenced_Attribute_Method__loop_on__Instance_Set = "c7ecd4986d054e07b1bcf7127d0d6666";
|
||||
|
||||
const Get_Specific_Instances_Method__has__Instance = "dea1aa0b2bef4bacb4f90ce8cf7006fc";
|
||||
|
||||
const Evaluate_Boolean_Expression_Method__has_source_attribute__Method = "45d76d5601ed46419f68cfe0c7d0d265";
|
||||
const Evaluate_Boolean_Expression_Method__equal_to_attribute__Method = "0646df917e3e4d59be71b978a22ced8e";
|
||||
|
||||
const Prompt_Value__has__Prompt = "7CD62362DDCE4BFC87B9B5499B0BC141";
|
||||
|
||||
const User__has_display_name__Translatable_Text_Constant = "6C29856C3B104F5BA291DD3CA4C04A2F";
|
||||
const User_Login__has__User = "85B40E4B849B4006A9C04E201B25975F";
|
||||
|
||||
const User__has_default__Page = "f00cda6feded4e0fb6c59675ed664a75";
|
||||
|
||||
const Dashboard__has__Dashboard_Content = "d26acf18afa54ccd8629e1d9dac394ed";
|
||||
const Dashboard_Content__for__Dashboard = "9f236d2d1f454096a69c42f37abbeebc";
|
||||
const Dashboard_Content__has__Instance = "1f0c40752b7d42c28488c7db06e91f5a";
|
||||
const Instance__for__Dashboard_Content = "376951c9252b48438e1dca89c94ddfa6";
|
||||
|
||||
const Return_Instance_Set_Method_Binding__has_source__Class = "EE7A30498E09410C84CBC2C0D652CF40";
|
||||
|
||||
const Report__has__Report_Column = "7A8F57F1A4F34BAF84A5E893FD79447D";
|
||||
const Report__has__Report_Data_Source = "1DE7B484F9E3476AA9D37D2A86B55845";
|
||||
const Report__has__Prompt = "5D112697303F419F886F3F09F0670B07";
|
||||
|
||||
const Report_Column__has__Report_Field = "B90269107E914EE1B5F2D7B740614831";
|
||||
const Report_Column__has__Report_Column_Option = "41FFF5F0B4674986A6FD46FAF4A479E9";
|
||||
|
||||
const Report_Data_Source__has_source__Method = "2D5CB496583946A09B9430D4E2227B56";
|
||||
|
||||
const Report_Field__has_source__Method = "5db86b7669bf421f96e74c49452db82e";
|
||||
const Attribute_Report_Field__has_target__Attribute = "3796430126FD41D886611F73684C0E0A";
|
||||
const Relationship_Report_Field__has_target__Relationship = "134B2790F6DF4F979AB59878C4A715E5";
|
||||
|
||||
|
||||
const Tenant__has__Application = "22936f5126294503a30ba02d61a6c0e0";
|
||||
const Tenant__has_sidebar__Menu_Item = "D62DFB9F48D54697AAAD1CAD0EA7ECFA";
|
||||
const Tenant__has__Tenant_Type = "E94B6C9D330748589726F24B7DB21E2D";
|
||||
|
||||
const Tenant__has_company_logo_image__File = "3540c81cb2294eacb9b59d4b4c6ad1eb";
|
||||
|
||||
const Menu__has__Menu_Section = "a22d949ff8d14dcca3ebd9f910228dfd";
|
||||
const Menu_Item__has_title__Translatable_Text_Constant = "65E3C87EA2F74A339FA7781EFA801E02";
|
||||
const Menu_Section__has__Menu_Item = "5b659d7c58f9453c9826dd3205c3c97f";
|
||||
|
||||
const Command_Menu_Item__has__Icon = "8859DAEF01F746FA8F3E7B2F28E0A520";
|
||||
|
||||
const Instance_Menu_Item__has_target__Instance = "C599C20EF01A4B12A9195DC3B0F545C2";
|
||||
|
||||
const Page__has_title__Translation = "7BE6522A4BE84CD38701C8353F7DF630";
|
||||
const Page__has__Style = "6E6E1A853EA94939B13ECBF645CB8B59";
|
||||
const Page__has__Page_Component = "24F6C596D77D4754B02300321DEBA924";
|
||||
|
||||
const Style__has__Style_Rule = "4CC8A654B2DF4B17A95624939530790E";
|
||||
const Style_Rule__has__Style_Property = "B69C2708E78D413AB491ABB6F1D2A6E0";
|
||||
|
||||
const Page__has_master__Page = "9bdbfd640915419f83fde8cf8bcc74ae";
|
||||
const Page__master_for__Page = "7fe8f2a2c94d401083aa9300cc99d71d";
|
||||
|
||||
const Page_Component__has__Style = "818CFF507D4243B2B6A792C3C54D450D";
|
||||
const Style__for__Page_Component = "007563E7727744368C8206D5F156D8E1";
|
||||
|
||||
const Button_Page_Component__has_text__Translatable_Text_Constant = "C25230B14D234CFE8B7556C33E8293AF";
|
||||
const Image_Page_Component__has_source__Method = "481E3FBEB82A4C769DDFD66C6BA8C590";
|
||||
|
||||
const Sequential_Container_Page_Component__has__Sequential_Container_Orientation = "DD55F50687184240A89421346656E804";
|
||||
const Container_Page_Component__has__Page_Component = "CB7B81621C9E4E72BBB8C1C37CA69CD5";
|
||||
|
||||
const Panel_Page_Component__has_header__Page_Component = "223B4073F41749CDBCA10E0749144B9D";
|
||||
const Panel_Page_Component__has_content__Page_Component = "AD8C5FAE24444700896EC5F968C0F85B";
|
||||
const Panel_Page_Component__has_footer__Page_Component = "56E339BD61894BACAB83999543FB8060";
|
||||
|
||||
const Element_Page_Component__has__Element = "fe833426e25d4cde89392a6c9baac20c";
|
||||
const Element_Page_Component__has__Element_Content_Display_Option = "74e3c13a04fd4f49be7005a32cdcdfe7";
|
||||
const Element_Content_Display_Option__for__Element_Page_Component = "7d3a7045092549db9b7d24863c9848a6";
|
||||
|
||||
const Element__for__Element_Page_Component = "963c5c60397947fab201a26839b9ded9";
|
||||
|
||||
const Tenant__has_logo_image__File = "4C399E80ECA24A68BFB426A5E6E97047";
|
||||
const Tenant__has_background_image__File = "39B0D9634BE049C8BFA2607051CB0101";
|
||||
const Tenant__has_icon_image__File = "CC4E65BD7AAA40DAAECAC607D7042CE3";
|
||||
const Tenant__has_login_header__Translatable_Text_Constant = "41D66ACBAFDE4B6F892DE66255F10DEB";
|
||||
const Tenant__has_login_footer__Translatable_Text_Constant = "A6203B6B5BEB4008AE49DB5E7DDBA45B";
|
||||
const Tenant__has_application_title__Translation = "7668343767ba46d9a5e72945be635345";
|
||||
const Tenant__has_mega__Menu = "cdd743cbc74a46719922652c7db9f2d8";
|
||||
|
||||
const Tenant_Type__has_title__Translatable_Text_Constant = "79AAE09C5690471C84421B230610456C";
|
||||
|
||||
const Prompt__has_title__Translatable_Text_Constant = "081ee211753443c499b524bd9537babc";
|
||||
|
||||
const Report__has_title__Translatable_Text_Constant = "DF93EFB08B5E49E78BC0553F9E7602F9";
|
||||
const Report__has_description__Translatable_Text_Constant = "D5AA18A77ACD4792B0396C620A151BAD";
|
||||
const Report_Field__has_title__Translatable_Text_Constant = "6780BFC2DBC040AE83EEBFEF979F0054";
|
||||
|
||||
const Content_Page_Component__gets_content_from__Method = "0E002E6FAA79457C93B82CCE1AEF5F7E";
|
||||
const Method__provides_content_for__Content_Page_Component = "5E75000D24214AD49E5FB9FDD9CB4744";
|
||||
|
||||
const Securable_Item__secured_by__Method = "15199c4995954288846d13b0ad5dcd4b";
|
||||
const Get_Relationship_Method__has__Relationship = "321581d660c1454783449d5bda027adc";
|
||||
|
||||
const Integration_ID__has__Integration_ID_Usage = "6cd30735df834253aabe360d6e1a3701";
|
||||
const Integration_ID_Usage__for__Integration_ID = "d8d981ec768640dab89f006c85042444";
|
||||
|
||||
const Conditional_Method__has__Conditional_Method_Case = "df2059e6650c49a88188570ccbe4fd2d";
|
||||
const Conditional_Method_Case__for__Conditional_Method = "be7a6285d70040f3868ec0878a3e94a6";
|
||||
|
||||
const Conditional_Method_Case__has_return_attribute__Method_Binding = "b6715132b4384073b81d3ecf19584b7d";
|
||||
const Method_Binding__returns_attribute_for__Conditional_Method_Case = "1c868a068fb7432d839b7a5a02a50eb6";
|
||||
|
||||
const Conditional_Method_Case__has_true_condition__Method_Binding = "d955da3f7ef443748b86167c73434f75";
|
||||
const Method_Binding__true_condition_for__Conditional_Method_Case = "1acdefd1e1b445bb99e1bf73dea71da5";
|
||||
|
||||
const Conditional_Method_Case__has_false_condition__Method_Binding = "e46dbc4fae8d4ad8b9e610cedfa68b73";
|
||||
const Method_Binding__false_condition_for__Conditional_Method_Case = "633af008bf7f4da194d667a9a80586d6";
|
||||
|
||||
const Audit_Line__has__Instance = "c91807ed0d734729990bd90750764fb5";
|
||||
const Audit_Line__has__User = "7c1e048d3dcb44739f2ee21014a76aa5";
|
||||
|
||||
const Method__has__Method_Parameter = "c455dc79ba9b4a7caf8e9ca59dbe511f";
|
||||
const Method_Parameter__for__Method = "0bcb6e5b58854747843ced4c3d3dc234";
|
||||
const Method__returns__Attribute = "eb015d320d4f4647b9b8715097f4434b";
|
||||
|
||||
const Detail_Page_Component__has_caption__Translation = "4a15fa44fb7b4e268ce2f36652792b48";
|
||||
|
||||
const Element__has__Element_Content = "c1d3248102f948c6baf837d93fa8da23";
|
||||
const Element_Content__for__Element = "2eff7f580edd40b79c0600774257649e";
|
||||
|
||||
const Element__has_label__Translation = "7147ea909f454bb9b151025b6e2bd834";
|
||||
|
||||
const Element_Content__has__Instance = "315b71ba953d45fc87e54f0a268242a9";
|
||||
const Instance__for__Element_Content = "c3959f84248d4edea3f2f262917c7b56";
|
||||
|
||||
const Element_Content__has__Element_Content_Display_Option = "f070dfa762604488a779fae291903f2d";
|
||||
|
||||
const Element_Content__has__Parameter_Assignment = "51214ef0458a44fa8b9df3d9d2309388";
|
||||
const Parameter__assigned_from__Element_Content = "dcef180ba2ca4d87bb05b946c319b562";
|
||||
|
||||
const Element_Content__has__Validation = "265637cd2099416b88fa4f5ed88a87e3";
|
||||
const Validation__for__Element_Content = "3a4677e89c78414980ad46e5ac3b12f5";
|
||||
|
||||
const Instance__has__Instance_Definition = "329c54ee17b84550ae80be5dee9ac53c";
|
||||
|
||||
const Task__has_initiating__Element = "78726736f5b74466b11429cbaf6c9329";
|
||||
const Element__initiates_for__Task = "36964c5d348e4f888a620a795b43bc14";
|
||||
|
||||
const Detail_Page_Component__has_row_source__Method_Binding = "54FBD0560BD444F4921C11FB0C77996E";
|
||||
const Detail_Page_Component__has_column_source__Method_Binding = "ddabeedaaa264d87a4574e7da921a293";
|
||||
|
||||
const Work_Set__has_valid__Class = "0808746241a5427184bca9bcd31a2c21";
|
||||
const Class__valid_for__Work_Set = "73c65dcf781047d498c0898ca1b17a68";
|
||||
|
||||
const Conditional_Select_Attribute_Case__invokes__Executable_returning_Attribute = "dbd974309c55430d815c77fce9887ba7";
|
||||
const Executable_returning_Attribute__invoked_by__Conditional_Select_Attribute_Case = "f4b04072abe8452ab8f8e0369dde24d4";
|
||||
|
||||
const Style__gets_background_image_File_from__Return_Instance_Set_Method_Binding = "4b4a0a3e426c4f70bc15b6efeb338486";
|
||||
|
||||
const Style__has__Style_Class = "2cebd83052aa44ff818db2d6ee273a1f";
|
||||
const Style_Class__for__Style = "b2fbce51455a42b59fd1c28bb0cbe613";
|
||||
|
||||
const Style__implements__Style = "99b1c16af2cb4cc5a3bb82a96335aa39";
|
||||
const Style__implemented_for__Style = "271ef8161e944f02a8054f9536c28dca";
|
||||
}
|
||||
?>
|
||||
10
webapp/mocha/oms/DatabaseOms.inc.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Mocha\Oms;
|
||||
|
||||
class DatabaseOms extends Oms
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
115
webapp/mocha/oms/MySQLDatabaseOms.inc.php
Normal file
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
namespace Mocha\Oms;
|
||||
|
||||
use Mocha\Core\InstanceKey;
|
||||
use Mocha\Core\InstanceReference;
|
||||
|
||||
class MySQLDatabaseOms extends DatabaseOms
|
||||
{
|
||||
public \PDO $PDO;
|
||||
|
||||
public function __construct($hostname, $port, $databasename, $username, $password)
|
||||
{
|
||||
$this->PDO = new \PDO("mysql:host=" . $hostname . ";port=" . $port . ";dbname=" . $databasename, $username, $password);
|
||||
}
|
||||
|
||||
public function getDbId($instRef)
|
||||
{
|
||||
if ($instRef == null)
|
||||
return 0;
|
||||
|
||||
return $instRef->DatabaseId;
|
||||
}
|
||||
|
||||
public function getInstanceByGlobalIdentifier(string $globalIdentifier) : ?InstanceReference
|
||||
{
|
||||
$query = "CALL mocha_get_instance_by_global_identifier(:global_identifier)";
|
||||
$stmt = $this->PDO->prepare($query);
|
||||
$result = $stmt->execute(array
|
||||
(
|
||||
"global_identifier" => $globalIdentifier
|
||||
));
|
||||
|
||||
if ($result === false)
|
||||
return null;
|
||||
|
||||
$values = $stmt->fetchAll();
|
||||
if (count($values) == 0)
|
||||
return null;
|
||||
|
||||
$dbid = $values[0]["id"];
|
||||
$class_id = $values[0]["class_id"];
|
||||
$inst_id = $values[0]["inst_id"];
|
||||
$global_id = $values[0]["global_identifier"];
|
||||
|
||||
$ir = new InstanceReference();
|
||||
$ir->DatabaseId = $dbid;
|
||||
$ir->GlobalIdentifier = $global_id;
|
||||
$ir->InstanceKey = new InstanceKey($class_id, $inst_id);
|
||||
return $ir;
|
||||
}
|
||||
|
||||
public function getRelatedInstances(InstanceReference $sourceInstance, InstanceReference $relationshipInstance, \DateTime $effectiveDate = null) : ?array
|
||||
{
|
||||
$dt = null;
|
||||
if ($effectiveDate !== null)
|
||||
{
|
||||
$dt = $effectiveDate->format("Y-m-d");
|
||||
}
|
||||
$query = "CALL mocha_get_related_instances(:src_inst_id, :rel_inst_id, :eff_date)";
|
||||
$stmt = $this->PDO->prepare($query);
|
||||
$result = $stmt->execute(array
|
||||
(
|
||||
"src_inst_id" => $this->getDbId($sourceInstance),
|
||||
"rel_inst_id" => $this->getDbId($relationshipInstance),
|
||||
"eff_date" => $dt
|
||||
));
|
||||
|
||||
if ($result === false)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$values = $stmt->fetchAll();
|
||||
if (count($values) >= 0)
|
||||
{
|
||||
$ret = array();
|
||||
foreach ($values as $value)
|
||||
{
|
||||
$retval = new InstanceReference();
|
||||
$retval->DatabaseId = $value["id"];
|
||||
$retval->InstanceKey = new InstanceKey($value["class_id"], $value["inst_id"]);
|
||||
$retval->GlobalIdentifier = $value["global_identifier"];
|
||||
$ret[] = $retval;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getAttributeValue($sourceInstance, $attributeInstance, $defaultValue = null, $effectiveDate = null) : ?string
|
||||
{
|
||||
$query = "CALL mocha_get_attribute_value(:src_inst_id, :attr_inst_id, :eff_date)";
|
||||
$stmt = $this->PDO->prepare($query);
|
||||
$result = $stmt->execute(array
|
||||
(
|
||||
"src_inst_id" => $this->getDbId($sourceInstance),
|
||||
"attr_inst_id" => $this->getDbId($attributeInstance),
|
||||
"eff_date" => $effectiveDate
|
||||
));
|
||||
|
||||
if ($result === false)
|
||||
{
|
||||
return $defaultValue;
|
||||
}
|
||||
|
||||
$values = $stmt->fetchAll();
|
||||
if (count($values) >= 0)
|
||||
{
|
||||
$value = $values[0]["att_value"];
|
||||
return $value;
|
||||
}
|
||||
return $defaultValue;
|
||||
}
|
||||
}
|
||||
?>
|
||||
51
webapp/mocha/oms/Oms.inc.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
namespace Mocha\Oms;
|
||||
|
||||
use Mocha\Core\InstanceKey;
|
||||
use Mocha\Core\InstanceReference;
|
||||
|
||||
use Mocha\Core\KnownClassGuids;
|
||||
use Mocha\Core\KnownInstanceGuids;
|
||||
use Mocha\Core\KnownAttributeGuids;
|
||||
|
||||
abstract class Oms
|
||||
{
|
||||
/**
|
||||
* Gets the instance with the specified global identifier.
|
||||
*/
|
||||
public function getInstanceByGlobalIdentifier(string $inst) : ?InstanceReference
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getRelatedInstances(InstanceReference $sourceInstance, InstanceReference $relationshipInstance, \DateTime $effectiveDate = null) : ?array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the instance representing the default tenant.
|
||||
*/
|
||||
public function getTenantInstance() : ?InstanceReference
|
||||
{
|
||||
return $this->getInstanceByGlobalIdentifier(KnownInstanceGuids::DefaultTenant);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the given attribute on the specified instance.
|
||||
*/
|
||||
public function getAttributeValue($sourceInstance, $attributeInstance, $defaultValue = null, $effectiveDate = null) : ?string
|
||||
{
|
||||
return null;
|
||||
}
|
||||
public function getInstanceText($inst)
|
||||
{
|
||||
return $this->getAttributeValue($inst, $this->getInstanceByGlobalIdentifier(KnownAttributeGuids::Name));
|
||||
}
|
||||
|
||||
public function setTenant($tenantName)
|
||||
{
|
||||
$this->_tenantName = $tenantName;
|
||||
}
|
||||
}
|
||||
?>
|
||||
30
webapp/mocha/system.inc.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
require("config.inc.php");
|
||||
|
||||
require("core/InstanceKey.inc.php");
|
||||
require("core/InstanceReference.inc.php");
|
||||
require("core/InstanceSet.inc.php");
|
||||
|
||||
require("core/KnownClassGuids.inc.php");
|
||||
require("core/KnownInstanceGuids.inc.php");
|
||||
require("core/KnownAttributeGuids.inc.php");
|
||||
require("core/KnownRelationshipGuids.inc.php");
|
||||
|
||||
require("oms/Oms.inc.php");
|
||||
require("oms/DatabaseOms.inc.php");
|
||||
require("oms/MySQLDatabaseOms.inc.php");
|
||||
|
||||
require("ui/DisplayOption.inc.php");
|
||||
require("ui/ElementContent.inc.php");
|
||||
|
||||
function getOMS()
|
||||
{
|
||||
global $oms;
|
||||
if ($oms == null)
|
||||
{
|
||||
$oms = new \Mocha\Oms\MySQLDatabaseOms("localhost", 3306, "mocha_0001", "mocha_0001", "4hpVLM4QDEfzwZwS");
|
||||
$oms->setTenant("default");
|
||||
}
|
||||
return $oms;
|
||||
}
|
||||
?>
|
||||
8
webapp/mocha/ui/DisplayOption.inc.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace Mocha\UI;
|
||||
|
||||
class DisplayOption
|
||||
{
|
||||
|
||||
}
|
||||
?>
|
||||
32
webapp/mocha/ui/ElementContent.inc.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace Mocha\UI;
|
||||
|
||||
use Mocha\Core\InstanceSet;
|
||||
|
||||
class ElementContent
|
||||
{
|
||||
private $_Text;
|
||||
private $_DisplayOptions;
|
||||
|
||||
public function __construct($text, $displayOptions)
|
||||
{
|
||||
$this->_Text = $text;
|
||||
$this->_DisplayOptions = new InstanceSet();
|
||||
for ($i = 0; $i < count($displayOptions); $i++)
|
||||
{
|
||||
$this->_DisplayOptions->add($displayOptions[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
public function getText()
|
||||
{
|
||||
return $this->_Text;
|
||||
}
|
||||
|
||||
public function getDisplayOptions()
|
||||
{
|
||||
return $this->_DisplayOptions;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
838
webapp/scripts/System.js
Normal file
@ -0,0 +1,838 @@
|
||||
function StringPadDirection(value)
|
||||
{
|
||||
this._value = value;
|
||||
}
|
||||
StringPadDirection.Left = new StringPadDirection(1);
|
||||
StringPadDirection.Right = new StringPadDirection(2);
|
||||
StringPadDirection.Both = new StringPadDirection(3);
|
||||
|
||||
function StringPad(str, len, pad, dir)
|
||||
{
|
||||
if (typeof(len) == "undefined") len = 0;
|
||||
if (typeof(pad) == "undefined") pad = ' ';
|
||||
if (typeof(dir) == "undefined") dir = StringPadDirection.Right;
|
||||
|
||||
if (len + 1 >= str.length)
|
||||
{
|
||||
if (dir == StringPadDirection.Left)
|
||||
{
|
||||
str = Array(len + 1 - str.length).join(pad) + str;
|
||||
}
|
||||
else if (dir == StringPadDirection.Both)
|
||||
{
|
||||
var right = Math.ceil((padlen = len - str.length) / 2);
|
||||
var left = padlen - right;
|
||||
str = Array(left+1).join(pad) + str + Array(right+1).join(pad);
|
||||
}
|
||||
else
|
||||
{
|
||||
str = str + Array(len + 1 - str.length).join(pad);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
String.prototype.padLeft = function(length, value)
|
||||
{
|
||||
return StringPad(this, length, value, StringPadDirection.Left);
|
||||
}
|
||||
String.prototype.padRight = function(length, value)
|
||||
{
|
||||
return StringPad(this, length, value, StringPadDirection.Right);
|
||||
}
|
||||
String.prototype.pad = function(length, value)
|
||||
{
|
||||
return StringPad(this, length, value, StringPadDirection.Both);
|
||||
}
|
||||
|
||||
/**
|
||||
* Event arguments for an event that can be canceled.
|
||||
*/
|
||||
function CancelEventArgs()
|
||||
{
|
||||
this.Cancel = false;
|
||||
}
|
||||
|
||||
function EventArgs()
|
||||
{
|
||||
}
|
||||
EventArgs.Empty = new EventArgs();
|
||||
|
||||
/**
|
||||
* Enumeration for mouse button values
|
||||
*/
|
||||
function MouseButtons()
|
||||
{
|
||||
}
|
||||
/**
|
||||
* No mouse buttons are being pressed.
|
||||
*/
|
||||
MouseButtons.None = 0;
|
||||
/**
|
||||
* The primary (usually left) button is being pressed.
|
||||
*/
|
||||
MouseButtons.Primary = 1;
|
||||
/**
|
||||
* The secondary (usually right) button is being pressed.
|
||||
*/
|
||||
MouseButtons.Secondary = 2;
|
||||
/**
|
||||
* The tertiary (usually wheel) button is being pressed.
|
||||
*/
|
||||
MouseButtons.Tertiary = 4;
|
||||
/**
|
||||
* The additional primary button is being pressed.
|
||||
*/
|
||||
MouseButtons.XButton1 = 8;
|
||||
/**
|
||||
* The additional secondary button is being pressed.
|
||||
*/
|
||||
MouseButtons.XButton2 = 16;
|
||||
|
||||
function MouseEventArgs(button, x, y)
|
||||
{
|
||||
this.Button = button;
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
this.NativeEventArgs = null;
|
||||
|
||||
this.Control = false;
|
||||
this.Alt = false;
|
||||
this.Shift = false;
|
||||
}
|
||||
|
||||
MouseEventArgs.FromNativeEventArgs = function(e)
|
||||
{
|
||||
var ee = new MouseEventArgs(0);
|
||||
ee.X = e.clientX;
|
||||
ee.Y = e.clientY;
|
||||
|
||||
ee.Control = e.ctrlKey;
|
||||
ee.Alt = e.altKey;
|
||||
ee.Shift = e.shiftKey;
|
||||
|
||||
ee.NativeEventArgs = e;
|
||||
|
||||
if (e.which)
|
||||
{
|
||||
switch (e.which)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
ee.Button |= MouseButtons.Primary;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ee.Button |= MouseButtons.Tertiary;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ee.Button |= MouseButtons.Secondary;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.button)
|
||||
{
|
||||
if ((e.button & 1) == 1) ee.Button |= MouseButtons.Primary;
|
||||
if ((e.button & 4) == 4) ee.Button |= MouseButtons.Tertiary;
|
||||
if ((e.button & 2) == 2) ee.Button |= MouseButtons.Secondary;
|
||||
}
|
||||
return ee;
|
||||
};
|
||||
function KeyboardKeys()
|
||||
{
|
||||
};
|
||||
/**
|
||||
* The ENTER key.
|
||||
*/
|
||||
KeyboardKeys.Enter = 13;
|
||||
/**
|
||||
* The ESC key.
|
||||
*/
|
||||
KeyboardKeys.Escape = 27;
|
||||
/**
|
||||
* The F1 function key.
|
||||
*/
|
||||
KeyboardKeys.F1 = 112;
|
||||
|
||||
KeyboardKeys.Control = 17;
|
||||
KeyboardKeys.Alt = 18;
|
||||
|
||||
KeyboardKeys.ArrowLeft = 37;
|
||||
KeyboardKeys.ArrowUp = 38;
|
||||
KeyboardKeys.ArrowRight = 39;
|
||||
KeyboardKeys.ArrowDown = 40;
|
||||
|
||||
KeyboardKeys.Meta = 91;
|
||||
KeyboardKeys.ContextMenu = 93;
|
||||
|
||||
/**
|
||||
* Enumeration for horizontal alignment values
|
||||
*/
|
||||
function HorizontalAlignment(value)
|
||||
{
|
||||
this._value = value;
|
||||
}
|
||||
/**
|
||||
* Specifies that content is aligned to the left.
|
||||
*/
|
||||
HorizontalAlignment.Left = new HorizontalAlignment(0);
|
||||
/**
|
||||
* Specifies that content is aligned in the center of the screen.
|
||||
*/
|
||||
HorizontalAlignment.Center = new HorizontalAlignment(1);
|
||||
/**
|
||||
* Specifies that content is aligned to the right.
|
||||
*/
|
||||
HorizontalAlignment.Right = new HorizontalAlignment(2);
|
||||
|
||||
/**
|
||||
* Enumeration for vertical alignment values
|
||||
*/
|
||||
function VerticalAlignment(value)
|
||||
{
|
||||
this._value = value;
|
||||
}
|
||||
/**
|
||||
* Specifies that content is aligned to the top.
|
||||
*/
|
||||
VerticalAlignment.Top = new VerticalAlignment(0);
|
||||
/**
|
||||
* Specifies that content is aligned in the middle of the screen.
|
||||
*/
|
||||
VerticalAlignment.Middle = new VerticalAlignment(1);
|
||||
/**
|
||||
* Specifies that content is aligned to the bottom.
|
||||
*/
|
||||
VerticalAlignment.Bottom = new VerticalAlignment(2);
|
||||
|
||||
function Callback(sender)
|
||||
{
|
||||
this._items = [];
|
||||
this._sender = sender;
|
||||
|
||||
this.Add = function(func)
|
||||
{
|
||||
this._items.push(func);
|
||||
};
|
||||
this.Execute = function(e)
|
||||
{
|
||||
for (var i = 0; i < this._items.length; i++)
|
||||
{
|
||||
this._items[i](this._sender, e);
|
||||
}
|
||||
};
|
||||
}
|
||||
function CallbackArgument()
|
||||
{
|
||||
}
|
||||
CallbackArgument.Empty = new CallbackArgument();
|
||||
|
||||
function Page()
|
||||
{
|
||||
}
|
||||
Page.Cookies = new Object();
|
||||
/**
|
||||
* Gets the cookie with the specified name.
|
||||
*/
|
||||
Page.Cookies.Get = function(name)
|
||||
{
|
||||
var cookie = document.cookie.split(';');
|
||||
for (var i = 0; i < cookie.length; i++)
|
||||
{
|
||||
var cookie1 = cookie[i].split(';', 2);
|
||||
if (cookie1[0] == name) return cookie1[1];
|
||||
}
|
||||
return null;
|
||||
};
|
||||
/**
|
||||
* Sets the cookie with the given name to the given value, and optionally sets an expiration date.
|
||||
* @param name string The name of the cookie to set or update.
|
||||
* @param value string The value of the cookie.
|
||||
* @param expires string The date and time at which the cookie should expire.
|
||||
*/
|
||||
Page.Cookies.Set = function(name, value, expires)
|
||||
{
|
||||
var cookie = name + "=" + value;
|
||||
if (expires)
|
||||
{
|
||||
cookie += ";expires=" + expires;
|
||||
}
|
||||
document.cookie = cookie;
|
||||
};
|
||||
|
||||
Page.Path = new Object();
|
||||
Page.Path.GetParts = function()
|
||||
{
|
||||
var p = window.location.href.substring(System.ExpandRelativePath("~/").length + 5);
|
||||
return p.split('/');
|
||||
};
|
||||
|
||||
/**
|
||||
* The Phast static members
|
||||
*/
|
||||
function System()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirects the browser to the given page.
|
||||
*/
|
||||
System.Redirect = function(path)
|
||||
{
|
||||
window.location.href = System.ExpandRelativePath(path);
|
||||
};
|
||||
/**
|
||||
* Expands the given path using the tilde (~) character and variable replacement.
|
||||
*/
|
||||
System.ExpandRelativePath = function(path)
|
||||
{
|
||||
if (System.BasePath === undefined)
|
||||
{
|
||||
var wlIndexOfP = window.location.href.indexOf("/", window.location.href.indexOf("/") + 2);
|
||||
var wlBasePath = window.location.href.substring(0, wlIndexOfP);
|
||||
System.BasePath = wlBasePath;
|
||||
}
|
||||
|
||||
var replpath = System.BasePath;
|
||||
if (System.IsTenanted)
|
||||
{
|
||||
replpath = replpath + "/" + System.GetTenantName();
|
||||
}
|
||||
return path.replace(/~\//, replpath + "/");
|
||||
};
|
||||
/**
|
||||
* Raises a custom DOM event on the given element.
|
||||
* @param element string The element on which to raise the event.
|
||||
* @param eventName string The name of the Event to raise.
|
||||
* @param args any Arguments passed into the event handler.
|
||||
*/
|
||||
System.RaiseEvent = function(element, eventName, args)
|
||||
{
|
||||
var event; // The custom event that will be created
|
||||
if (document.createEvent)
|
||||
{
|
||||
event = document.createEvent("HTMLEvents");
|
||||
event.initEvent(eventName, true, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
event = document.createEventObject();
|
||||
event.eventType = eventName;
|
||||
}
|
||||
event.eventName = eventName;
|
||||
|
||||
if (document.createEvent)
|
||||
{
|
||||
return element.dispatchEvent(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
element.fireEvent("on" + eventName, event);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Provides an event handler for custom-handled events.
|
||||
* @deprecated Use DOM events and System.RaiseEvent() instead.
|
||||
*/
|
||||
System.EventHandler = function()
|
||||
{
|
||||
this._functions = new Array();
|
||||
this.Add = function (func)
|
||||
{
|
||||
this._functions.push(func);
|
||||
};
|
||||
this.Clear = function()
|
||||
{
|
||||
this._functions = new Array();
|
||||
};
|
||||
this.Execute = function(sender, e)
|
||||
{
|
||||
for (var i = 0; i < this._functions.length; i++)
|
||||
{
|
||||
var retval = this._functions[i](sender, e);
|
||||
if (!retval) return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
};
|
||||
System.Navigation = new Object();
|
||||
/**
|
||||
* Retrieves partial content from a URL and loads it into the specified element's innerHTML property.
|
||||
*
|
||||
* @param url string The URL to fetch.
|
||||
* @param targetFrame string The DOM element in which to load the data.
|
||||
* @param throbber DOMElement The DOM element used as the waiting indicator (optional).
|
||||
* @param throbberClassDefault string The CSS class for the waiting indicator (optional).
|
||||
* @param throbberClassHidden string The CSS class for the hidden waiting indicator (optional).
|
||||
* @param throbberClassVisible string The CSS class for the visible waiting indicator (optional).
|
||||
*/
|
||||
System.Navigation.LoadPartialContent = function(url, targetFrame, async, throbber, throbberClassDefault, throbberClassHidden, throbberClassVisible)
|
||||
{
|
||||
if (typeof(async) === "undefined") async = false;
|
||||
if (!throbberClassDefault) throbberClassDefault = "";
|
||||
if (!throbberClassHidden) throbberClassHidden = "Hidden";
|
||||
if (!throbberClassVisible) throbberClassHidden = "Visible";
|
||||
|
||||
// fetch the data from the URL, should be a same-origin URL
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function()
|
||||
{
|
||||
if (this.readyState == 4)
|
||||
{
|
||||
targetFrame.innerHTML = xhr.responseText;
|
||||
if (throbber)
|
||||
{
|
||||
var cssclass = "";
|
||||
if (throbberClassDefault) cssclass += throbberClassDefault + " ";
|
||||
if (throbberClassVisible) cssclass += throbberClassHidden;
|
||||
throbber.className = cssclass;
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.open('GET', url, async);
|
||||
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||
xhr.send(null);
|
||||
|
||||
if (throbber)
|
||||
{
|
||||
var cssclass = "";
|
||||
if (throbberClassDefault) cssclass += throbberClassDefault + " ";
|
||||
if (throbberClassVisible) cssclass += throbberClassVisible;
|
||||
throbber.className = cssclass;
|
||||
}
|
||||
};
|
||||
System.TerminateIfSenderIs = function(sender, compareTo)
|
||||
{
|
||||
while (sender != null)
|
||||
{
|
||||
if (sender.classList)
|
||||
{
|
||||
for (var i = 0; i < compareTo.length; i++)
|
||||
{
|
||||
if (System.ClassList.Contains(sender, compareTo[i]))
|
||||
{
|
||||
// do not close the popup when we click inside itself
|
||||
// e.preventDefault();
|
||||
// e.stopPropagation();
|
||||
// alert(compareTo[i] + " = " + sender.className + " ? true ");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
sender = sender.parentNode;
|
||||
if (sender == null) break;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
/**
|
||||
* Enters full screen mode on the specified element. If no element is specified, the entire page becomes full screen.
|
||||
* @param element DOMElement The element with which to fill the screen. If not specified, document.body will be used.
|
||||
*/
|
||||
System.EnterFullScreen = function(element)
|
||||
{
|
||||
if (!element) element = document.body;
|
||||
if (element.requestFullscreen)
|
||||
{
|
||||
// The HTML5 way
|
||||
element.requestFullscreen();
|
||||
}
|
||||
else if (element.webkitRequestFullscreen)
|
||||
{
|
||||
// The WebKit (safari/chrome) way
|
||||
element.webkitRequestFullscreen();
|
||||
}
|
||||
else if (element.mozRequestFullScreen)
|
||||
{
|
||||
// The Firefox way
|
||||
element.mozRequestFullScreen();
|
||||
}
|
||||
else if (element.msRequestFullscreen)
|
||||
{
|
||||
// The Internet Explorer way
|
||||
element.msRequestFullscreen();
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Exits full screen mode.
|
||||
*/
|
||||
System.ExitFullScreen = function()
|
||||
{
|
||||
if (document.exitFullscreen)
|
||||
{
|
||||
document.exitFullscreen();
|
||||
}
|
||||
else if (document.webkitExitFullscreen)
|
||||
{
|
||||
document.webkitExitFullscreen();
|
||||
}
|
||||
else if (document.mozCancelFullScreen)
|
||||
{
|
||||
document.mozCancelFullScreen();
|
||||
}
|
||||
else if (document.msExitFullscreen)
|
||||
{
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the predefined Phast events that are passed into event handlers.
|
||||
*/
|
||||
System.Events = new Object();
|
||||
|
||||
System.Events.MouseClick = new Object();
|
||||
System.Events.MouseClick.Name = "click";
|
||||
|
||||
/**
|
||||
* The event that is raised when the mouse wheel is scrolled over an element.
|
||||
*/
|
||||
System.Events.MouseWheel = new Object();
|
||||
//FF doesn't recognize mousewheel as of FF3.x
|
||||
/**
|
||||
* Gets the name of this event.
|
||||
*/
|
||||
System.Events.MouseWheel.Name = ((/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel");
|
||||
/**
|
||||
* Gets the event arguments for this event.
|
||||
*/
|
||||
System.Events.GetEventArgs = function(e)
|
||||
{
|
||||
var delta = e.detail ? e.detail * (-120) : e.wheelDelta;
|
||||
// delta returns +120 when wheel is scrolled up, -120 when scrolled down
|
||||
var evt =
|
||||
{
|
||||
"Cancel": false,
|
||||
"Delta": delta
|
||||
};
|
||||
return evt;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the value of the ClientProperty with the given propertyName for the control with the given controlName.
|
||||
* @param controlName string The name of the control for which to retrieve a ClientProperty.
|
||||
* @param propertyName string The name of the property to search for.
|
||||
*/
|
||||
System.GetClientProperty = function(controlName, propertyName)
|
||||
{
|
||||
return Page.Cookies.Get(controlName + "__ClientProperty_" + propertyName);
|
||||
};
|
||||
/**
|
||||
* Sets the value of the ClientProperty with the given propertyName for the control with the given controlName to the given propertyValue.
|
||||
* @param controlName string The name of the control for which to update a ClientProperty.
|
||||
* @param propertyName string The name of the property to search for.
|
||||
* @param propertyValue string The new value of the property.
|
||||
*/
|
||||
System.SetClientProperty = function(controlName, propertyName, propertyValue)
|
||||
{
|
||||
Page.Cookies.Set(controlName + "__ClientProperty_" + propertyName, propertyValue);
|
||||
};
|
||||
/**
|
||||
* Adds an event listener with the given eventTypeOrName to the parent element.
|
||||
* @param parent DOMElement The element on which to add an event listener.
|
||||
* @param eventTypeOrName string The name of the event for which to add a listener, minus the "on" prefix.
|
||||
* @param callback EventListener The event listener that will be called when this event is raised.
|
||||
*/
|
||||
System.AddEventListener = function(parent, eventTypeOrName, callback)
|
||||
{
|
||||
function CustomCallback(evt)
|
||||
{
|
||||
if (typeof eventTypeOrName.GetEventArgs !== 'undefined')
|
||||
{
|
||||
var eas = eventTypeOrName.GetEventArgs(evt);
|
||||
eas.Cancel = false;
|
||||
callback(eas);
|
||||
if (eas.Cancel)
|
||||
{
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var eas = evt;
|
||||
eas.Cancel = false;
|
||||
callback(eas);
|
||||
if (eas.Cancel)
|
||||
{
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof eventTypeOrName !== "object")
|
||||
{
|
||||
if (parent.attachEvent)
|
||||
{
|
||||
//if IE (and Opera depending on user setting)
|
||||
parent.attachEvent("on" + eventTypeOrName, callback);
|
||||
}
|
||||
else if (parent.addEventListener) //WC3 browsers
|
||||
{
|
||||
parent.addEventListener(eventTypeOrName, callback, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parent.attachEvent)
|
||||
{
|
||||
//if IE (and Opera depending on user setting)
|
||||
parent.attachEvent("on" + eventTypeOrName.Name, CustomCallback);
|
||||
}
|
||||
else if (parent.addEventListener) //WC3 browsers
|
||||
{
|
||||
parent.addEventListener(eventTypeOrName.Name, CustomCallback, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
System.ClassList =
|
||||
{
|
||||
"Add": function (object, className)
|
||||
{
|
||||
if (object.classList && object.classList.add)
|
||||
{
|
||||
object.classList.add(className);
|
||||
return true;
|
||||
}
|
||||
else if (object.className !== undefined)
|
||||
{
|
||||
var splits = object.className.split(" ");
|
||||
for (var i = 0; i < splits.length; i++)
|
||||
{
|
||||
if (splits[i] == className) return true;
|
||||
}
|
||||
splits.push(className);
|
||||
object.className = splits.join(" ");
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("System.ClassList.Add failed: the following object does not define classList or className");
|
||||
console.log(object);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
"Remove": function (object, className)
|
||||
{
|
||||
if (object.classList && object.classList.remove)
|
||||
{
|
||||
object.classList.remove(className);
|
||||
return true;
|
||||
}
|
||||
|
||||
var splits = object.className.split(" ");
|
||||
var newsplits = new Array();
|
||||
for (var i = 0; i < splits.length; i++)
|
||||
{
|
||||
if (splits[i] == className) continue;
|
||||
newsplits.push(splits[i]);
|
||||
}
|
||||
object.className = newsplits.join(" ");
|
||||
return false;
|
||||
},
|
||||
"Contains": function (object, className)
|
||||
{
|
||||
if (object.classList && object.classList.contains)
|
||||
{
|
||||
if (typeof(className) === "string")
|
||||
{
|
||||
return object.classList.contains(className);
|
||||
}
|
||||
else
|
||||
{
|
||||
// implement ContainsAny(array).
|
||||
for (var i = 0; i < className.length; i++)
|
||||
{
|
||||
if (object.classList.contains(className[i]))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!object.className) return false;
|
||||
|
||||
var splits = object.className.split(" ");
|
||||
for (var i = 0; i < splits.length; i++)
|
||||
{
|
||||
if (typeof(className) === "string")
|
||||
{
|
||||
if (splits[i] == className) return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// implement ContainsAny(array).
|
||||
for (var j = 0; j < className.length; j++)
|
||||
{
|
||||
if (splits[i] == className[j])
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
"Toggle": function (object, className)
|
||||
{
|
||||
if (System.ClassList.Contains(object, className))
|
||||
{
|
||||
System.ClassList.Remove(object, className);
|
||||
}
|
||||
else
|
||||
{
|
||||
System.ClassList.Add(object, className);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
System.Screen =
|
||||
{
|
||||
"Size":
|
||||
{
|
||||
"GetHeight": function()
|
||||
{
|
||||
return document.documentElement.clientHeight;
|
||||
},
|
||||
"GetWidth": function()
|
||||
{
|
||||
return document.documentElement.clientWidth;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
System.StringMethods =
|
||||
{
|
||||
"Contains": function(string, value)
|
||||
{
|
||||
if (string.includes) return string.includes(value);
|
||||
if (string.contains) return string.contains(value);
|
||||
|
||||
console.error("Neither String.includes nor String.contains were found");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
System.AddEventListener(window, "load", function()
|
||||
{
|
||||
// automatically remove the spinner when the document has finished loading
|
||||
window.setTimeout(function()
|
||||
{
|
||||
System.ClassList.Remove(document.body, "uwt-loading");
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
var WebPage =
|
||||
{
|
||||
"Postback": function(url)
|
||||
{
|
||||
var WebPageForm = document.getElementById("WebPageForm");
|
||||
if (url)
|
||||
{
|
||||
// Set the action of the WebPageForm to the specified PostBackURL before submitting
|
||||
WebPageForm.action = url;
|
||||
}
|
||||
if (!WebPageForm)
|
||||
{
|
||||
console.warn("WebPage.Postback: could not find WebPageForm, postbacks are not enabled");
|
||||
return;
|
||||
}
|
||||
WebPageForm.submit();
|
||||
},
|
||||
"IsVariableDefined": function(name)
|
||||
{
|
||||
var txtWebPageVariable = document.getElementById("WebPageVariable_" + name + "_Value");
|
||||
if (!txtWebPageVariable) return false;
|
||||
return true;
|
||||
},
|
||||
"IsVariableSet": function(name)
|
||||
{
|
||||
var txtWebPageVariable_IsSet = document.getElementById("WebPageVariable_" + name + "_IsSet");
|
||||
if (!txtWebPageVariable_IsSet)
|
||||
{
|
||||
console.warn("WebPage.IsVariableSet: undefined variable '" + name + "'");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
"ClearVariableValue": function(name, value)
|
||||
{
|
||||
var txtWebPageVariable = document.getElementById("WebPageVariable_" + name + "_Value");
|
||||
var txtWebPageVariable_IsSet = document.getElementById("WebPageVariable_" + name + "_IsSet");
|
||||
if (!txtWebPageVariable || !txtWebPageVariable_IsSet)
|
||||
{
|
||||
console.error("WebPage.ClearVariableValue: undefined variable '" + name + "'");
|
||||
return false;
|
||||
}
|
||||
txtWebPageVariable_IsSet.value = "false";
|
||||
txtWebPageVariable.value = "";
|
||||
|
||||
WebPage.Postback();
|
||||
return true;
|
||||
},
|
||||
"GetVariableValue": function(name)
|
||||
{
|
||||
var txtWebPageVariable = document.getElementById("WebPageVariable_" + name + "_Value");
|
||||
if (!txtWebPageVariable)
|
||||
{
|
||||
console.error("WebPage.GetVariableValue: undefined variable '" + name + "'");
|
||||
return null;
|
||||
}
|
||||
return txtWebPageVariable.value;
|
||||
},
|
||||
"SetVariableValue": function(name, value, autoPostback)
|
||||
{
|
||||
var txtWebPageVariable = document.getElementById("WebPageVariable_" + name + "_Value");
|
||||
var txtWebPageVariable_IsSet = document.getElementById("WebPageVariable_" + name + "_IsSet");
|
||||
if (!txtWebPageVariable || !txtWebPageVariable_IsSet)
|
||||
{
|
||||
console.error("WebPage.GetVariableValue: undefined variable '" + name + "'");
|
||||
return false;
|
||||
}
|
||||
txtWebPageVariable_IsSet.value = "true";
|
||||
txtWebPageVariable.value = value;
|
||||
|
||||
if (autoPostback !== false)
|
||||
{
|
||||
WebPage.Postback();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Provide the XMLHttpRequest constructor for Internet Explorer 5.x-6.x:
|
||||
Other browsers (including Internet Explorer 7.x-9.x) do not redefine
|
||||
XMLHttpRequest if it already exists.
|
||||
|
||||
This example is based on findings at:
|
||||
http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx
|
||||
*/
|
||||
if (typeof XMLHttpRequest === "undefined")
|
||||
{
|
||||
XMLHttpRequest = function ()
|
||||
{
|
||||
try
|
||||
{
|
||||
return new ActiveXObject("Msxml2.XMLHTTP.6.0");
|
||||
}
|
||||
catch (e) {}
|
||||
try
|
||||
{
|
||||
return new ActiveXObject("Msxml2.XMLHTTP.3.0");
|
||||
}
|
||||
catch (e) {}
|
||||
try
|
||||
{
|
||||
return new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
catch (e) {}
|
||||
console.log("This browser does not support XMLHttpRequest.");
|
||||
};
|
||||
}
|
||||