Merged in luisfernandosl/processmaker/PM-2291 (pull request #1951)

PM-2291 "DesignerBPMN>CaseTracker: No se visualizan los..." SOLVED
This commit is contained in:
Julio Cesar Laura Avendaño
2015-04-17 18:45:08 -04:00
3 changed files with 90 additions and 9 deletions

View File

@@ -3,7 +3,7 @@
/**
* class.pmDynaform.php
* Implementing pmDynaform library in the running case.
*
*
* @author Roly Rudy Gutierrez Pinto
* @package engine.classes
*/
@@ -154,7 +154,7 @@ class pmDynaform
array_push($json->options, $option);
}
} catch (Exception $e) {
}
}
if (isset($json->options[0])) {
@@ -253,6 +253,72 @@ class pmDynaform
return $this->record != null && $this->record["DYN_VERSION"] == 2 ? true : false;
}
public function printViewWithoutSubmit()
{
ob_clean();
$json = G::json_decode($this->record["DYN_CONTENT"]);
foreach ($json->items[0]->items as $key => $value) {
switch ($json->items[0]->items[$key][0]->type) {
case "submit":
unset($json->items[0]->items[$key]);
break;
}
}
$this->jsonr($json);
$javascript = "
<script type=\"text/javascript\">
var jsondata = " . G::json_encode($json) . ";
var pm_run_outside_main_app = \"\";
var dyn_uid = \"" . $this->fields["CURRENT_DYNAFORM"] . "\";
var __DynaformName__ = \"" . $this->record["PRO_UID"] . "_" . $this->record["DYN_UID"] . "\";
var app_uid = \"" . $this->fields["APP_UID"] . "\";
var prj_uid = \"" . $this->fields["PRO_UID"] . "\";
var step_mode = \"\";
var workspace = \"" . SYS_SYS . "\";
var credentials = " . G::json_encode($this->credentials) . ";
var filePost = \"\";
var fieldsRequired = null;
var triggerDebug = false;
$(window).load(function ()
{
var data = jsondata;
data.items[0].mode = \"disabled\";
window.project = new PMDynaform.core.Project({
data: data,
keys: {
server: location.host,
projectId: prj_uid,
workspace: workspace
},
token: credentials,
submitRest: false
});
$(document).find(\"form\").submit(function (e) {
e.preventDefault();
return false;
});
});
</script>
<div style=\"margin: 10px 20px 10px 0;\">
<div style=\"float: right\"><a href=\"javascript: window.history.go(-1);\" style=\"text-decoration: none;\">&lt; " . G::LoadTranslation("ID_BACK") . "</a></div>
<div style=\"clear: both\"></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}", $javascript, $file);
echo $file;
exit(0);
}
public function printView()
{
ob_clean();