This commit is contained in:
Marco Antonio Nina Mena
2017-12-04 13:25:35 +00:00
committed by Julio Cesar Laura Avendaño
parent abe71a6ffe
commit 0d533e19d9
363 changed files with 23948 additions and 44623 deletions

View File

@@ -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');
@@ -541,7 +541,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")) {
@@ -549,8 +549,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);
}
@@ -570,13 +571,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
@@ -1127,12 +1128,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']);
@@ -1166,7 +1170,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;'>&nbsp;\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" .
@@ -1451,16 +1455,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"]);
}
@@ -1651,8 +1660,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) {
@@ -1787,7 +1797,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();
@@ -1892,7 +1902,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);
@@ -2042,7 +2052,8 @@ class PmDynaform
break;
case 'form':
$arrayGrid = array_merge(
$arrayGrid, self::getGridsAndFields($field, $flagGridAssocToVar)
$arrayGrid,
self::getGridsAndFields($field, $flagGridAssocToVar)
);
break;
}
@@ -2138,7 +2149,8 @@ class PmDynaform
$value === "suggest" ||
$value === "hidden" ||
$value === "file" ||
$value === "grid")) {
$value === "grid"
)) {
if ($value === "grid" && $property === "data") {
$json->{$property} = [];
} else {