HOR-4601
This commit is contained in:
@@ -40,7 +40,7 @@ class PmDynaform
|
||||
$this->context = \Bootstrap::getDefaultContextLog();
|
||||
$this->dataSources = array("database", "dataVariable");
|
||||
$this->pathRTLCss = '/lib/pmdynaform/build/css/PMDynaform-rtl.css';
|
||||
$this->serverConf = &ServerConf::getSingleton();
|
||||
$this->serverConf = ServerConf::getSingleton();
|
||||
$this->isRTL = ($this->serverConf->isRtl(SYS_LANG)) ? 'true' : 'false';
|
||||
$this->fields = $fields;
|
||||
$this->propertiesToExclude = array('dataVariable');
|
||||
@@ -546,7 +546,7 @@ class PmDynaform
|
||||
$json->data->label = $io->label;
|
||||
}
|
||||
}
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = Array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
}
|
||||
}
|
||||
if ($key === "type" && ($value === "checkgroup")) {
|
||||
@@ -554,8 +554,9 @@ class PmDynaform
|
||||
$dataValue = array();
|
||||
$dataLabel = array();
|
||||
$dv = array();
|
||||
if (isset($this->fields["APP_DATA"][$json->name]))
|
||||
if (isset($this->fields["APP_DATA"][$json->name])) {
|
||||
$dv = $this->fields["APP_DATA"][$json->name];
|
||||
}
|
||||
if (!is_array($dv)) {
|
||||
$dv = explode(",", $dv);
|
||||
}
|
||||
@@ -575,13 +576,13 @@ class PmDynaform
|
||||
}
|
||||
$json->data->value = $dataValue;
|
||||
$json->data->label = G::json_encode($dataLabel);
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = Array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
}
|
||||
}
|
||||
if ($key === "type" && ($value === "datetime")) {
|
||||
if (isset($this->fields["APP_DATA"]["__VAR_CHANGED__"]) && in_array($json->name, explode(",", $this->fields["APP_DATA"]["__VAR_CHANGED__"]))) {
|
||||
$json->data->label = $json->data->value;
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = Array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
}
|
||||
}
|
||||
//clear optionsSql
|
||||
@@ -711,7 +712,8 @@ class PmDynaform
|
||||
if ($value[0] === $json->variable) {
|
||||
continue;
|
||||
}
|
||||
$jsonSearch = $this->jsonsf(G::json_decode($this->record["DYN_CONTENT"]), $value[0], $json->variable === "" ? "id" : "variable");
|
||||
$jsonDecode = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$jsonSearch = $this->jsonsf($jsonDecode, $value[0], $json->variable === "" ? "id" : "variable");
|
||||
$a = $this->getValuesDependentFields($jsonSearch);
|
||||
foreach ($a as $i => $v) {
|
||||
$data[$i] = $v;
|
||||
@@ -1132,12 +1134,15 @@ class PmDynaform
|
||||
$msg = "";
|
||||
if (isset($_SESSION['G_MESSAGE_TYPE']) && isset($_SESSION['G_MESSAGE'])) {
|
||||
$color = "green";
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "ERROR")
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "ERROR") {
|
||||
$color = "red";
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "WARNING")
|
||||
}
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "WARNING") {
|
||||
$color = "#C3C380";
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "INFO")
|
||||
}
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "INFO") {
|
||||
$color = "green";
|
||||
}
|
||||
$msg = "<div style='background-color:" . $color . ";color: white;padding: 1px 2px 1px 5px;' class='userGroupTitle'>" . $_SESSION['G_MESSAGE_TYPE'] . ": " . $_SESSION['G_MESSAGE'] . "</div>";
|
||||
unset($_SESSION['G_MESSAGE_TYPE']);
|
||||
unset($_SESSION['G_MESSAGE']);
|
||||
@@ -1171,7 +1176,7 @@ class PmDynaform
|
||||
"</script>\n" .
|
||||
"<script type='text/javascript' src='/jscore/cases/core/cases_Step.js'></script>\n" .
|
||||
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
|
||||
($this->fields["PRO_SHOW_MESSAGE"] === 1 ? '' : $title ) .
|
||||
($this->fields["PRO_SHOW_MESSAGE"] === 1 ? '' : $title) .
|
||||
"<div style='width:100%;padding:0px 10px 0px 10px;margin:15px 0px 0px 0px;'>\n" .
|
||||
" <img src='/images/bulletButtonLeft.gif' style='float:left;'> \n" .
|
||||
" <a id='dyn_backward' href='" . $this->fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["PREVIOUS_STEP"] . "' style='float:left;font-size:12px;line-height:1;margin:0px 0px 1px 5px;'>\n" .
|
||||
@@ -1456,16 +1461,21 @@ class PmDynaform
|
||||
if (!$sw1 && !$sw2) {
|
||||
if ($key === "variable" && $json->variable === $oldVariable["VAR_NAME"]) {
|
||||
$json->variable = $newVariable["VAR_NAME"];
|
||||
if (isset($json->dataType))
|
||||
if (isset($json->dataType)) {
|
||||
$json->dataType = $newVariable["VAR_FIELD_TYPE"];
|
||||
if (isset($json->name))
|
||||
}
|
||||
if (isset($json->name)) {
|
||||
$json->name = $newVariable["VAR_NAME"];
|
||||
if (isset($json->dbConnection) && $json->dbConnection === $oldVariable["VAR_DBCONNECTION"])
|
||||
}
|
||||
if (isset($json->dbConnection) && $json->dbConnection === $oldVariable["VAR_DBCONNECTION"]) {
|
||||
$json->dbConnection = $newVariable["VAR_DBCONNECTION"];
|
||||
if (isset($json->dbConnectionLabel) && $json->dbConnectionLabel === $oldVariable["VAR_DBCONNECTION_LABEL"])
|
||||
}
|
||||
if (isset($json->dbConnectionLabel) && $json->dbConnectionLabel === $oldVariable["VAR_DBCONNECTION_LABEL"]) {
|
||||
$json->dbConnectionLabel = $newVariable["VAR_DBCONNECTION_LABEL"];
|
||||
if (isset($json->sql) && $json->sql === $oldVariable["VAR_SQL"])
|
||||
}
|
||||
if (isset($json->sql) && $json->sql === $oldVariable["VAR_SQL"]) {
|
||||
$json->sql = $newVariable["VAR_SQL"];
|
||||
}
|
||||
if (isset($json->options) && G::json_encode($json->options) === $oldVariable["VAR_ACCEPTED_VALUES"]) {
|
||||
$json->options = G::json_decode($newVariable["VAR_ACCEPTED_VALUES"]);
|
||||
}
|
||||
@@ -1656,8 +1666,9 @@ class PmDynaform
|
||||
$sw2 = is_object($value);
|
||||
if ($sw1 || $sw2) {
|
||||
$val = $this->jsonsf($value, $id, $for);
|
||||
if ($val !== null)
|
||||
if ($val !== null) {
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
if (!$sw1 && !$sw2) {
|
||||
if ($key === $for && $id === $value) {
|
||||
@@ -1792,7 +1803,7 @@ class PmDynaform
|
||||
if ($oPro->getDynLabel() !== null && $oPro->getDynLabel() !== "") {
|
||||
$dyn_labels = G::json_decode($oPro->getDynLabel());
|
||||
}
|
||||
$dyn_labels->$name[count($name) - 2] = $content;
|
||||
$dyn_labels->{$name[count($name) - 2]} = $content;
|
||||
|
||||
$oPro->setDynLabel(G::json_encode($dyn_labels));
|
||||
$oPro->save();
|
||||
@@ -1897,7 +1908,7 @@ class PmDynaform
|
||||
{
|
||||
$result = array();
|
||||
$previusFunction = $this->onPropertyRead;
|
||||
$this->onPropertyRead = function($json, $key, $value) use (&$post) {
|
||||
$this->onPropertyRead = function ($json, $key, $value) use (&$post) {
|
||||
if ($key === "type" && isset($json->variable) && !empty($json->variable)) {
|
||||
//clears the data in the appData for grids
|
||||
$isThereIdIntoPost = array_key_exists($json->id, $post);
|
||||
@@ -2047,7 +2058,8 @@ class PmDynaform
|
||||
break;
|
||||
case 'form':
|
||||
$arrayGrid = array_merge(
|
||||
$arrayGrid, self::getGridsAndFields($field, $flagGridAssocToVar)
|
||||
$arrayGrid,
|
||||
self::getGridsAndFields($field, $flagGridAssocToVar)
|
||||
);
|
||||
break;
|
||||
}
|
||||
@@ -2143,7 +2155,8 @@ class PmDynaform
|
||||
$value === "suggest" ||
|
||||
$value === "hidden" ||
|
||||
$value === "file" ||
|
||||
$value === "grid")) {
|
||||
$value === "grid"
|
||||
)) {
|
||||
if ($value === "grid" && $property === "data") {
|
||||
$json->{$property} = [];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user