PM-3553 "0018427: Un usuario asignado como Process Supervisor no..." SOLVED
Issue:
0018427: Un usuario asignado como Process Supervisor no puede editar los dynaforms
Cause:
En este modulo se define el DynaForm como "view"
Solution:
Se completa en este modulo la edicion y guardado de datos del DynaForm
This commit is contained in:
committed by
Enrique Ponce De Leon
parent
8b39e13166
commit
43d3ec1384
@@ -182,7 +182,7 @@ class pmDynaform
|
||||
array_push($json->optionsSql, $option);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (isset($json->options[0])) {
|
||||
@@ -475,6 +475,55 @@ class pmDynaform
|
||||
exit();
|
||||
}
|
||||
|
||||
public function printEditSupervisor()
|
||||
{
|
||||
ob_clean();
|
||||
|
||||
$json = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$this->jsonr($json);
|
||||
|
||||
$msg = "";
|
||||
|
||||
if (isset($_SESSION["G_MESSAGE_TYPE"]) && isset($_SESSION["G_MESSAGE"])) {
|
||||
$msg = "<div style=\"margin: 1.2em; border: 1px solid #3C763D; padding: 0.5em; background: #B2D3B3;\"><strong>" . G::LoadTranslation("ID_INFO") . "</strong>: " . $_SESSION["G_MESSAGE"] . "</div>";
|
||||
|
||||
unset($_SESSION["G_MESSAGE_TYPE"]);
|
||||
unset($_SESSION["G_MESSAGE"]);
|
||||
}
|
||||
|
||||
$javascrip = "
|
||||
<script type=\"text/javascript\">
|
||||
var jsondata = " . G::json_encode($json) . ";
|
||||
var pm_run_outside_main_app = null;
|
||||
var dyn_uid = \"" . $this->fields["CURRENT_DYNAFORM"] . "\";
|
||||
var __DynaformName__ = \"" . $this->fields["PRO_UID"] . "_" . $this->fields["CURRENT_DYNAFORM"] . "\";
|
||||
var app_uid = \"" . $this->fields["APP_UID"] . "\";
|
||||
var prj_uid = \"" . $this->fields["PRO_UID"] . "\";
|
||||
var step_mode = null;
|
||||
var workspace = \"" . SYS_SYS . "\";
|
||||
var credentials = " . G::json_encode($this->credentials) . ";
|
||||
var filePost = \"cases_SaveDataSupervisor?UID=" . $this->fields["CURRENT_DYNAFORM"] . "\";
|
||||
var fieldsRequired = null;
|
||||
var triggerDebug = null;
|
||||
</script>
|
||||
|
||||
<script type=\"text/javascript\" src=\"/jscore/cases/core/pmDynaform.js\"></script>
|
||||
|
||||
<div>
|
||||
$msg
|
||||
<div style=\"display: none;\">
|
||||
<a id=\"dyn_forward\" href=\"javascript:;\"></a>
|
||||
</div>
|
||||
</div>
|
||||
";
|
||||
|
||||
$file = file_get_contents(PATH_HOME . "public_html" . PATH_SEP . "lib" . PATH_SEP . "pmdynaform" . PATH_SEP . "build" . PATH_SEP . "pmdynaform.html");
|
||||
$file = str_replace("{javascript}", $javascrip, $file);
|
||||
|
||||
echo $file;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
public function printWebEntry($filename)
|
||||
{
|
||||
ob_clean();
|
||||
@@ -967,3 +1016,4 @@ class pmDynaform
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -46,14 +46,10 @@ try {
|
||||
* DYN_VERSION is 1: classic Dynaform,
|
||||
* DYN_VERSION is 2: responsive form, Pmdynaform.
|
||||
*/
|
||||
$a = new Criteria("workflow");
|
||||
$a->addSelectColumn(DynaformPeer::DYN_VERSION);
|
||||
$a->add(DynaformPeer::DYN_UID, $_GET['UID'], Criteria::EQUAL);
|
||||
$a = ProcessPeer::doSelectRS($a);
|
||||
$a->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$a->next();
|
||||
$row = $a->getRow();
|
||||
$swpmdynaform = isset($row) && $row["DYN_VERSION"] == 2;
|
||||
$dynaForm = DynaformPeer::retrieveByPK($_GET["UID"]);
|
||||
|
||||
$swpmdynaform = !is_null($dynaForm) && $dynaForm->getDynVersion() == 2;
|
||||
|
||||
if ($swpmdynaform) {
|
||||
$pmdynaform = $_POST["form"];
|
||||
}
|
||||
@@ -149,7 +145,7 @@ try {
|
||||
$aRow = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($aRow) {
|
||||
foreach ($aValues as $sKey => $sValue) {
|
||||
if ($sKey != $oForm->fields[$sField]->pmfield) {
|
||||
|
||||
@@ -22,6 +22,15 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
//validate the data post
|
||||
|
||||
$dynaForm = DynaformPeer::retrieveByPK($_GET["UID"]);
|
||||
|
||||
$flagDynaFormNewVersion = !is_null($dynaForm) && $dynaForm->getDynVersion() == 2;
|
||||
|
||||
if ($flagDynaFormNewVersion) {
|
||||
$dataForm = $_POST["form"];
|
||||
}
|
||||
|
||||
$oForm = new Form( $_SESSION['PROCESS'] . '/' . $_GET['UID'], PATH_DYNAFORM );
|
||||
$oForm->validatePost();
|
||||
|
||||
@@ -31,6 +40,11 @@ G::LoadClass( 'case' );
|
||||
//load the variables
|
||||
$oCase = new Cases();
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
|
||||
if ($flagDynaFormNewVersion) {
|
||||
$Fields["APP_DATA"] = array_merge($Fields["APP_DATA"], $dataForm);
|
||||
}
|
||||
|
||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], $_POST['form'] );
|
||||
|
||||
//save data
|
||||
|
||||
@@ -129,7 +129,7 @@ if ($_GET['DYN_UID'] != '') {
|
||||
$FieldsPmDynaform["CURRENT_DYNAFORM"] = $_GET['DYN_UID'];
|
||||
$a = new pmDynaform($FieldsPmDynaform);
|
||||
if ($a->isResponsive()) {
|
||||
$a->printView();
|
||||
$a->printEditSupervisor();
|
||||
}else{
|
||||
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['DYN_UID'], '', $Fields['APP_DATA'], 'cases_SaveDataSupervisor?UID=' . $_GET['DYN_UID'] );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user