Merged colosa/processmaker into master
This commit is contained in:
@@ -16,6 +16,7 @@ class pmDynaform
|
||||
public $credentials = null;
|
||||
public $lang = null;
|
||||
public $langs = null;
|
||||
private $dependent = null; //todo
|
||||
|
||||
public function __construct($fields = array())
|
||||
{
|
||||
@@ -184,6 +185,21 @@ class pmDynaform
|
||||
if ($json->data["label"] === "") {
|
||||
$json->data["label"] = $json->data["value"];
|
||||
}
|
||||
//synchronize data label
|
||||
$withoutOptions = true;
|
||||
foreach ($json->options as $io) {
|
||||
if ($json->data["value"] === $io["value"]) {
|
||||
if ($json->data["label"] != $io["label"]) {
|
||||
$this->dependent = $json->variable; //todo
|
||||
$json->data["label"] = $io["label"];
|
||||
$withoutOptions = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($withoutOptions) {
|
||||
$json->data["label"] = $json->data["value"];//todo
|
||||
}
|
||||
//end synchronize data label
|
||||
}
|
||||
if ($key === "type" && ($value === "checkbox")) {
|
||||
$json->data = array(
|
||||
@@ -253,6 +269,27 @@ class pmDynaform
|
||||
}
|
||||
}
|
||||
|
||||
public function jsond(&$json)
|
||||
{
|
||||
foreach ($json as $key => &$value) {
|
||||
$sw1 = is_array($value);
|
||||
$sw2 = is_object($value);
|
||||
if ($sw1 || $sw2) {
|
||||
$this->jsond($value);
|
||||
}
|
||||
if (!$sw1 && !$sw2) {
|
||||
if (isset($json->dbConnection) && $json->dbConnection !== "" && $json->dbConnection !== "none" && isset($json->sql) && $json->sql != "") {
|
||||
$prefix = array("@@", "@#", "@%", "@?", "@$", "@=");
|
||||
foreach ($prefix as $val) {
|
||||
if (strpos($json->sql, $val . $this->dependent) !== false) {
|
||||
$json->data = array("value" => "", "label" => "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function isResponsive()
|
||||
{
|
||||
return $this->record != null && $this->record["DYN_VERSION"] == 2 ? true : false;
|
||||
@@ -273,6 +310,7 @@ class pmDynaform
|
||||
}
|
||||
|
||||
$this->jsonr($json);
|
||||
$this->jsond($json); //todo
|
||||
|
||||
$javascript = "
|
||||
<script type=\"text/javascript\">
|
||||
@@ -329,6 +367,7 @@ class pmDynaform
|
||||
ob_clean();
|
||||
$json = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$this->jsonr($json);
|
||||
$this->jsond($json); //todo
|
||||
$javascrip = "" .
|
||||
"<script type='text/javascript'>\n" .
|
||||
"var jsondata = " . G::json_encode($json) . ";\n" .
|
||||
@@ -374,6 +413,7 @@ class pmDynaform
|
||||
ob_clean();
|
||||
$json = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$this->jsonr($json);
|
||||
$this->jsond($json); //todo
|
||||
if (!isset($this->fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["PREVIOUS_STEP"])) {
|
||||
$this->fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["PREVIOUS_STEP"] = "";
|
||||
}
|
||||
@@ -421,6 +461,7 @@ class pmDynaform
|
||||
ob_clean();
|
||||
$json = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$this->jsonr($json);
|
||||
$this->jsond($json); //todo
|
||||
$javascrip = "" .
|
||||
"<script type='text/javascript'>\n" .
|
||||
"var jsondata = " . G::json_encode($json) . ";\n" .
|
||||
@@ -456,6 +497,7 @@ class pmDynaform
|
||||
$this->record = $record;
|
||||
$json = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$this->jsonr($json);
|
||||
$this->jsond($json); //todo
|
||||
$javascrip = "" .
|
||||
"<script type='text/javascript'>\n" .
|
||||
"var jsondata = " . G::json_encode($json) . ";\n" .
|
||||
@@ -487,6 +529,7 @@ class pmDynaform
|
||||
{
|
||||
$json = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$this->jsonr($json);
|
||||
$this->jsond($json); //todo
|
||||
$javascrip = "" .
|
||||
"<script type='text/javascript'>" .
|
||||
"var jsonData = " . G::json_encode($json) . ";" .
|
||||
@@ -505,6 +548,7 @@ class pmDynaform
|
||||
$this->record = $record;
|
||||
$json = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$this->jsonr($json);
|
||||
$this->jsond($json); //todo
|
||||
$javascrip = "" .
|
||||
"<script type='text/javascript'>\n" .
|
||||
"var jsondata = " . G::json_encode($json) . ";\n" .
|
||||
|
||||
@@ -212,7 +212,7 @@ CREATE TABLE `DYNAFORM`
|
||||
`DYN_CONTENT` MEDIUMTEXT,
|
||||
`DYN_LABEL` MEDIUMTEXT,
|
||||
`DYN_VERSION` INTEGER NOT NULL,
|
||||
`DYN_UPDATE_DATE` DATETIME default '' NOT NULL,
|
||||
`DYN_UPDATE_DATE` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`DYN_UID`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Forms required';
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@@ -1190,6 +1190,12 @@ class TimerEvent
|
||||
$criteria->addSelectColumn(\BpmnEventPeer::EVN_NAME);
|
||||
$criteria->addSelectColumn(\ElementTaskRelationPeer::TAS_UID);
|
||||
|
||||
$arrayCondition = array();
|
||||
$arrayCondition[] = array(\TimerEventPeer::PRJ_UID, \ProcessPeer::PRO_UID, \Criteria::EQUAL);
|
||||
$criteria->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
|
||||
|
||||
$criteria->add(\ProcessPeer::PRO_STATUS, "ACTIVE", \Criteria::EQUAL);
|
||||
|
||||
$arrayCondition = array();
|
||||
$arrayCondition[] = array(\TimerEventPeer::PRJ_UID, \ElementTaskRelationPeer::PRJ_UID, \Criteria::EQUAL);
|
||||
$arrayCondition[] = array(\TimerEventPeer::EVN_UID, \ElementTaskRelationPeer::ELEMENT_UID, \Criteria::EQUAL);
|
||||
@@ -1257,6 +1263,8 @@ class TimerEvent
|
||||
if ((int)($hour . $minute) <= (int)($hourCase . $minuteCase)) {
|
||||
$flagCase = $hourCase == $hour && $minuteCase == $minute;
|
||||
} else {
|
||||
$timerEventNextRunDateNew = $this->getNextRunDateByDataAndDatetime($arrayTimerEventData, $datetime); //Generate new date for old TMREVN_NEXT_RUN_DATE
|
||||
|
||||
$flagCase = true; //Create the old case
|
||||
}
|
||||
}
|
||||
@@ -1361,6 +1369,12 @@ class TimerEvent
|
||||
$criteriaMain->addSelectColumn(\AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||
$criteriaMain->addSelectColumn(\BpmnEventPeer::EVN_NAME);
|
||||
|
||||
$arrayCondition = array();
|
||||
$arrayCondition[] = array(\AppDelegationPeer::PRO_UID, \ProcessPeer::PRO_UID, \Criteria::EQUAL);
|
||||
$criteriaMain->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
|
||||
|
||||
$criteriaMain->add(\ProcessPeer::PRO_STATUS, "ACTIVE", \Criteria::EQUAL);
|
||||
|
||||
$arrayCondition = array();
|
||||
$arrayCondition[] = array(\AppDelegationPeer::APP_UID, \ApplicationPeer::APP_UID, \Criteria::EQUAL);
|
||||
$criteriaMain->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
|
||||
|
||||
@@ -75,7 +75,12 @@ class Variable
|
||||
$variable->setVarDefault($arrayData["VAR_DEFAULT"]);
|
||||
}
|
||||
if (isset($arrayData["VAR_ACCEPTED_VALUES"])) {
|
||||
$encodeAcceptedValues = json_encode($arrayData["VAR_ACCEPTED_VALUES"]);
|
||||
$VAR_ACCEPTED_VALUES = $arrayData["VAR_ACCEPTED_VALUES"];
|
||||
foreach($VAR_ACCEPTED_VALUES as $key => $val) {
|
||||
$VAR_ACCEPTED_VALUES[$key]["label"] = htmlentities($val["label"], ENT_IGNORE, 'UTF-8');
|
||||
$VAR_ACCEPTED_VALUES[$key]["value"] = htmlentities($val["value"], ENT_IGNORE, 'UTF-8');
|
||||
}
|
||||
$encodeAcceptedValues = html_entity_decode(json_encode($VAR_ACCEPTED_VALUES), ENT_IGNORE, 'UTF-8');
|
||||
$variable->setVarAcceptedValues($encodeAcceptedValues);
|
||||
}
|
||||
$variable->save();
|
||||
@@ -168,7 +173,12 @@ class Variable
|
||||
$variable->setVarDefault($arrayData["VAR_DEFAULT"]);
|
||||
}
|
||||
if (isset($arrayData["VAR_ACCEPTED_VALUES"])) {
|
||||
$encodeAcceptedValues = json_encode($arrayData["VAR_ACCEPTED_VALUES"]);
|
||||
$VAR_ACCEPTED_VALUES = $arrayData["VAR_ACCEPTED_VALUES"];
|
||||
foreach($VAR_ACCEPTED_VALUES as $key => $val) {
|
||||
$VAR_ACCEPTED_VALUES[$key]["label"] = htmlentities($val["label"], ENT_IGNORE,'UTF-8');
|
||||
$VAR_ACCEPTED_VALUES[$key]["value"] = htmlentities($val["value"], ENT_IGNORE,'UTF-8');
|
||||
}
|
||||
$encodeAcceptedValues = html_entity_decode(json_encode($VAR_ACCEPTED_VALUES), ENT_IGNORE, 'UTF-8');
|
||||
$variable->setVarAcceptedValues($encodeAcceptedValues);
|
||||
}
|
||||
$variable->save();
|
||||
|
||||
@@ -1492,38 +1492,6 @@ Ext.onReady(function() {
|
||||
listeners: {
|
||||
render: function(){
|
||||
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING_GRID')});
|
||||
},
|
||||
"cellclick": function (grid, rowIndex, columnIndex, e) {
|
||||
var record = grid.getStore().getAt(rowIndex);
|
||||
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
|
||||
|
||||
if (fieldName != "status") {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (record.get("status")) {
|
||||
case "upgrade":
|
||||
case "ready":
|
||||
if (INTERNET_CONNECTION == 1) {
|
||||
installAddon(record.get("id"), record.get("store"));
|
||||
} else {
|
||||
Ext.MessageBox.alert(_('ID_INFORMATION'), _('ID_NO_INTERNET_CONECTION'));
|
||||
}
|
||||
break;
|
||||
case "download":
|
||||
Ext.Ajax.request({
|
||||
url: "addonsStoreAction",
|
||||
params: {
|
||||
"action": "cancel",
|
||||
"addon": record.get("id"),
|
||||
"store": record.get("store")
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "available":
|
||||
addonAvailable(record.get("id"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1251,6 +1251,8 @@ importProcess = function()
|
||||
Ext.MessageBox.show({
|
||||
title: _("ID_ERROR"),
|
||||
msg: "<div style=\"overflow: auto; width: 500px; height: 150px;\">" + stringReplace("\\x0A", "<br />", resp_.message) + "</div>", //\n 10
|
||||
width: 570,
|
||||
height: 250,
|
||||
icon: Ext.MessageBox.ERROR,
|
||||
buttons: Ext.MessageBox.OK
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user