Merged colosa/processmaker into master
This commit is contained in:
32
Rakefile
32
Rakefile
@@ -153,6 +153,38 @@ def buildPmdynaform(homeDir, targetDir, mode)
|
||||
system("rm #{pmdynaformDir}/build/appBuild.js")
|
||||
readyForm = ""
|
||||
system("echo '#{readyForm}' >> #{pmdynaformDir}/build/appBuild.js ")
|
||||
system("cp #{Dir.pwd}/workflow/engine/templates/cases/cases_Step_Pmdynaform.html #{pmdynaformDir}/build/cases_Step_Pmdynaform.html")
|
||||
system("cp #{Dir.pwd}/workflow/engine/templates/cases/cases_Step_Pmdynaform_Preview.html #{pmdynaformDir}/build/cases_Step_Pmdynaform_Preview.html")
|
||||
|
||||
template = ""
|
||||
config = File.read "#{homeDir}/config/templates.json"
|
||||
json = JSON.parse config
|
||||
json.each do |key|
|
||||
s = ""
|
||||
key["files"].each do |source|
|
||||
s += File.read "#{homeDir}/#{source}"
|
||||
s += "\n"
|
||||
end
|
||||
template += s
|
||||
end
|
||||
|
||||
target = "#{pmdynaformDir}/build/cases_Step_Pmdynaform.html"
|
||||
html = File.read target
|
||||
while html['###TEMPLATES##'] do
|
||||
html['###TEMPLATES###'] = template
|
||||
end
|
||||
File.open(target, 'w+') do |file|
|
||||
file.write html
|
||||
end
|
||||
|
||||
target = "#{pmdynaformDir}/build/cases_Step_Pmdynaform_Preview.html"
|
||||
html = File.read target
|
||||
while html['###TEMPLATES##'] do
|
||||
html['###TEMPLATES###'] = template
|
||||
end
|
||||
File.open(target, 'w+') do |file|
|
||||
file.write html
|
||||
end
|
||||
|
||||
puts "\nPmDynaform Build Finished!".magenta
|
||||
end
|
||||
|
||||
@@ -14,6 +14,163 @@ require_once 'classes/model/om/BaseBpmnParticipant.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class BpmnParticipant extends BaseBpmnParticipant {
|
||||
class BpmnParticipant extends BaseBpmnParticipant
|
||||
{
|
||||
private $bound;
|
||||
|
||||
public function __construct($generateUid = true)
|
||||
{
|
||||
$this->bound = new BpmnBound();
|
||||
$this->setBoundDefaults();
|
||||
}
|
||||
|
||||
public function getBound()
|
||||
{
|
||||
return $this->bound;
|
||||
}
|
||||
|
||||
private function setBoundDefaults()
|
||||
{
|
||||
$this->bound->setBouElementType(lcfirst(str_replace(__NAMESPACE__, '', __CLASS__)));
|
||||
$this->bound->setBouElement('pm_canvas');
|
||||
$this->bound->setBouContainer('bpmnDiagram');
|
||||
|
||||
$this->bound->setPrjUid($this->getPrjUid());
|
||||
$this->bound->setElementUid($this->getParUid());
|
||||
|
||||
$process = BpmnProcessPeer::retrieveByPK($this->getProUid());
|
||||
|
||||
if (is_object($process)) {
|
||||
$this->bound->setDiaUid($process->getDiaUid());
|
||||
}
|
||||
}
|
||||
|
||||
public static function findOneBy($field, $value)
|
||||
{
|
||||
$rows = self::findAllBy($field, $value);
|
||||
|
||||
return empty($rows) ? null : $rows[0];
|
||||
}
|
||||
|
||||
public static function findAllBy($field, $value)
|
||||
{
|
||||
$c = new Criteria('workflow');
|
||||
$c->add($field, $value, Criteria::EQUAL);
|
||||
|
||||
return BpmnParticipantPeer::doSelect($c);
|
||||
}
|
||||
|
||||
public static function getAll($prjUid = null, $start = null, $limit = null, $filter = '', $changeCaseTo = CASE_UPPER)
|
||||
{
|
||||
$c = new Criteria('workflow');
|
||||
$c->addSelectColumn("BPMN_PARTICIPANT.*");
|
||||
$c->addSelectColumn("BPMN_BOUND.*");
|
||||
$c->addJoin(BpmnParticipantPeer::PAR_UID, BpmnBoundPeer::ELEMENT_UID, Criteria::LEFT_JOIN);
|
||||
|
||||
if (! is_null($prjUid)) {
|
||||
$c->add(BpmnParticipantPeer::PRJ_UID, $prjUid, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
$rs = BpmnParticipantPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$participants = array();
|
||||
|
||||
while ($rs->next()) {
|
||||
$participants[] = $changeCaseTo !== CASE_UPPER ? array_change_key_case($rs->getRow(), CASE_LOWER) : $rs->getRow();
|
||||
}
|
||||
|
||||
return $participants;
|
||||
}
|
||||
|
||||
// OVERRIDES
|
||||
|
||||
public function setParUid($actUid)
|
||||
{
|
||||
parent::setParUid($actUid);
|
||||
$this->bound->setElementUid($this->getParUid());
|
||||
}
|
||||
|
||||
public function setPrjUid($prjUid)
|
||||
{
|
||||
parent::setPrjUid($prjUid);
|
||||
$this->bound->setPrjUid($this->getPrjUid());
|
||||
}
|
||||
|
||||
public function setProUid($proUid)
|
||||
{
|
||||
parent::setProUid($proUid);
|
||||
|
||||
$process = BpmnProcessPeer::retrieveByPK($this->getProUid());
|
||||
$this->bound->setDiaUid($process->getDiaUid());
|
||||
}
|
||||
|
||||
public function save($con = null)
|
||||
{
|
||||
parent::save($con);
|
||||
|
||||
$this->setBoundDefaults();
|
||||
|
||||
if ($this->bound->getBouUid() == "") {
|
||||
$this->bound->setBouUid(\ProcessMaker\Util\Common::generateUID());
|
||||
}
|
||||
|
||||
$this->bound->save($con);
|
||||
}
|
||||
|
||||
public function delete($con = null)
|
||||
{
|
||||
// first, delete the related bound object
|
||||
if (! is_object($this->bound) || $this->bound->getBouUid() == "") {
|
||||
$this->bound = BpmnBound::findByElement('Participant', $this->getParUid());
|
||||
}
|
||||
|
||||
if (is_object($this->bound)) {
|
||||
$this->bound->delete($con);
|
||||
}
|
||||
|
||||
parent::delete($con);
|
||||
}
|
||||
|
||||
public function fromArray($data, $type = BasePeer::TYPE_FIELDNAME)
|
||||
{
|
||||
parent::fromArray($data, $type);
|
||||
|
||||
$bound = BpmnBound::findByElement('Participant', $this->getParUid());
|
||||
|
||||
if (is_object($bound)) {
|
||||
$this->bound = $bound;
|
||||
} else {
|
||||
$this->bound = new BpmnBound();
|
||||
$this->bound->setBouUid(ProcessMaker\Util\Common::generateUID());
|
||||
}
|
||||
|
||||
$this->bound->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
}
|
||||
|
||||
public function toArray($type = BasePeer::TYPE_FIELDNAME)
|
||||
{
|
||||
$data = parent::toArray($type);
|
||||
$bouUid = $this->bound->getBouUid();
|
||||
|
||||
if (empty($bouUid)) {
|
||||
$bound = BpmnBound::findByElement('Participant', $this->getParUid());
|
||||
|
||||
if (is_object($bound)) {
|
||||
$this->bound = $bound;
|
||||
}
|
||||
}
|
||||
|
||||
$data = array_merge($data, $this->bound->toArray($type));
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function exists($actUid)
|
||||
{
|
||||
$c = new Criteria("workflow");
|
||||
$c->add(BpmnParticipantPeer::PAR_UID, $actUid);
|
||||
|
||||
return BpmnParticipantPeer::doCount($c) > 0 ? true : false;
|
||||
}
|
||||
} // BpmnParticipant
|
||||
|
||||
@@ -270,7 +270,8 @@ try {
|
||||
$ds->next();
|
||||
$row = $ds->getRow();
|
||||
if (isset($row) && $row["DYN_VERSION"] == 2) {
|
||||
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step_Pmdynaform.html');
|
||||
//$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step_Pmdynaform.html');
|
||||
$oTemplatePower = new TemplatePower(PATH_HOME . 'public_html/lib/pmdynaform/build/cases_Step_Pmdynaform.html');
|
||||
$oTemplatePower->prepare();
|
||||
$oTemplatePower->assign("JSON_DATA", $row["DYN_CONTENT"]);
|
||||
$oTemplatePower->assign("CASE", $array["CASE"]);
|
||||
|
||||
@@ -1001,5 +1001,168 @@ class DynaForm
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data of a DynaForm
|
||||
*
|
||||
* @param string $projectUid Unique id of Project
|
||||
* @param string $dynaFormUid Unique id of DynaForm
|
||||
*
|
||||
* return array Return an array with data of a DynaForm
|
||||
*/
|
||||
public function getDynaFormFields($projectUid, $dynaFormUid)
|
||||
{
|
||||
try {
|
||||
$arrayVariables = array();
|
||||
//Verify data
|
||||
Validator::proUid($projectUid, '$prj_uid');
|
||||
$this->throwExceptionIfNotExistsDynaForm($dynaFormUid, "", $this->arrayFieldNameForException["dynaFormUid"]);
|
||||
|
||||
//Get data
|
||||
$criteria = new \Criteria("workflow");
|
||||
$criteria->addSelectColumn(\DynaformPeer::DYN_CONTENT);
|
||||
$criteria->add(\DynaformPeer::DYN_UID, $dynaFormUid, \Criteria::EQUAL);
|
||||
$rsCriteria = \DynaformPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rsCriteria->next();
|
||||
|
||||
$aRow = $rsCriteria->getRow();
|
||||
$contentDecode = json_decode($aRow['DYN_CONTENT'],true);
|
||||
|
||||
$content = $contentDecode['items'][0]['items'];
|
||||
|
||||
foreach ($content as $key => $value) {
|
||||
|
||||
$valueType = (isset($value[0]["valueType"])) ? $value[0]["valueType"]:null;
|
||||
$maxLength = (isset($value[0]["maxLength"])) ? $value[0]["maxLength"]:null;
|
||||
$label = (isset($value[0]["label"])) ? $value[0]["label"]:null;
|
||||
$defaultValue = (isset($value[0]["defaultValue"])) ? $value[0]["defaultValue"]:null;
|
||||
$required = (isset($value[0]["required"])) ? $value[0]["required"]:null;
|
||||
$dbConnection = (isset($value[0]["dbConnection"])) ? $value[0]["dbConnection"]:null;
|
||||
$sql = (isset($value[0]["sql"])) ? $value[0]["sql"]:null;
|
||||
$options = (isset($value[0]["options"])) ? $value[0]["options"]:null;
|
||||
//fields properties
|
||||
$type = (isset($value[0]["type"])) ? $value[0]["type"]:null;
|
||||
$colSpan = (isset($value[0]["colSpan"])) ? $value[0]["colSpan"]:null;
|
||||
$name = (isset($value[0]["name"])) ? $value[0]["name"]:null;
|
||||
$readonly = (isset($value[0]["readonly"])) ? $value[0]["readonly"]:null;
|
||||
$hint = (isset($value[0]["hint"])) ? $value[0]["hint"]:null;
|
||||
$dependentsField = (isset($value[0]["dependentsField"])) ? $value[0]["dependentsField"]:null;
|
||||
$placeHolder = (isset($value[0]["placeHolder"])) ? $value[0]["placeHolder"]:null;
|
||||
$pickType = (isset($value[0]["pickType"])) ? $value[0]["pickType"]:null;
|
||||
|
||||
if (isset($value[0]["variable"])) {
|
||||
$variable = $value[0]["variable"];
|
||||
|
||||
$criteria = new \Criteria("workflow");
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_UID);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::PRJ_UID);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NAME);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_FIELD_TYPE);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_FIELD_SIZE);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_LABEL);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_DBCONNECTION);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_SQL);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NULL);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_DEFAULT);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_ACCEPTED_VALUES);
|
||||
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $projectUid, \Criteria::EQUAL);
|
||||
$criteria->add(\ProcessVariablesPeer::VAR_NAME, $variable, \Criteria::EQUAL);
|
||||
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rsCriteria->next();
|
||||
|
||||
while ($aRow = $rsCriteria->getRow()) {
|
||||
|
||||
if ($valueType == null && $valueType == '') {
|
||||
$valueTypeMerged = $aRow['VAR_FIELD_TYPE'];
|
||||
} else {
|
||||
$valueTypeMerged = $valueType;
|
||||
}
|
||||
if ($maxLength == null && $maxLength == '') {
|
||||
$maxLengthMerged = (int)$aRow['VAR_FIELD_SIZE'];
|
||||
} else {
|
||||
$maxLengthMerged = $maxLength;
|
||||
}
|
||||
if ($label == null && $label == '') {
|
||||
$labelMerged = $aRow['VAR_LABEL'];
|
||||
} else {
|
||||
$labelMerged = $label;
|
||||
}
|
||||
if ($defaultValue == null && $defaultValue == '') {
|
||||
$defaultValueMerged = $aRow['VAR_DEFAULT'];
|
||||
} else {
|
||||
$defaultValueMerged = $defaultValue;
|
||||
}
|
||||
if ($required == null && $required == '') {
|
||||
$requiredMerged = ($aRow['VAR_NULL']==1) ? true:false;
|
||||
} else {
|
||||
$requiredMerged = $required;
|
||||
}
|
||||
if ($dbConnection == null && $dbConnection == '') {
|
||||
$dbConnectionMerged = $aRow['VAR_DBCONNECTION'];
|
||||
} else {
|
||||
$dbConnectionMerged = $dbConnection;
|
||||
}
|
||||
if ($sql == null && $sql == '') {
|
||||
$sqlMerged = $aRow['VAR_SQL'];
|
||||
} else {
|
||||
$sqlMerged = $sql;
|
||||
}
|
||||
if ($options == null && $options == '') {
|
||||
$optionsMerged = $aRow['VAR_ACCEPTED_VALUES'];
|
||||
} else {
|
||||
$optionsMerged = $options;
|
||||
}
|
||||
|
||||
$arrayVariables[] = array( 'variable' => $variable,
|
||||
'valueType' => $valueTypeMerged,
|
||||
'maxLength' => $maxLengthMerged,
|
||||
'label' => $labelMerged,
|
||||
'defaultValue' => $defaultValueMerged,
|
||||
'required' => $requiredMerged,
|
||||
'dbConnection' => $dbConnectionMerged,
|
||||
'sql' => $sqlMerged,
|
||||
'options' => $optionsMerged,
|
||||
//values from fields properties
|
||||
'type' => $type,
|
||||
'colSpan' => $colSpan,
|
||||
'name' => $name,
|
||||
'readonly' => $readonly,
|
||||
'hint' => $hint,
|
||||
'dependentsField' => $dependentsField,
|
||||
'placeHolder' => $placeHolder,
|
||||
'pickType' => $pickType);
|
||||
$rsCriteria->next();
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
$arrayVariables[] = array( 'valueType' => $valueType,
|
||||
'maxLength' => $maxLength,
|
||||
'label' => $label,
|
||||
'defaultValue' => $defaultValue,
|
||||
'required' => $required,
|
||||
'dbConnection' => $dbConnection,
|
||||
'sql' => $sql,
|
||||
'options' => $options,
|
||||
'type' => $type,
|
||||
'colSpan' => $colSpan,
|
||||
'name' => $name,
|
||||
'readonly' => $readonly,
|
||||
'hint' => $hint,
|
||||
'dependentsField' => $dependentsField,
|
||||
'placeHolder' => $placeHolder,
|
||||
'pickType' => $pickType);
|
||||
}
|
||||
}
|
||||
//Return
|
||||
return $arrayVariables;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -673,6 +673,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$diagram["laneset"] = $bwp->getLanesets($configList);
|
||||
$diagram["lanes"] = $bwp->getLanes($configList);
|
||||
$diagram["data"] = $bwp->getDataCollection($configList);
|
||||
$diagram["participants"] = $bwp->getParticipants($configList);
|
||||
$project["diagrams"][] = $diagram;
|
||||
}
|
||||
|
||||
@@ -962,6 +963,53 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
}
|
||||
}
|
||||
|
||||
////
|
||||
/*
|
||||
* Diagram's Participant Handling
|
||||
*/
|
||||
$whiteList = array();
|
||||
foreach ($diagram["participants"] as $i => $participantData) {
|
||||
$participantData = array_change_key_case($participantData, CASE_UPPER);
|
||||
unset($participantData["_EXTENDED"]);
|
||||
|
||||
$dataObject = $bwp->getParticipant($participantData["PAR_UID"]);
|
||||
|
||||
if ($forceInsert || is_null($dataObject)) {
|
||||
if ($generateUid) {
|
||||
//Event
|
||||
unset($participantData["BOU_UID"]);
|
||||
|
||||
$uidOld = $participantData["PAR_UID"];
|
||||
$participantData["PAR_UID"] = Util\Common::generateUID();
|
||||
|
||||
$result[] = array(
|
||||
"object" => "participant",
|
||||
"old_uid" => $uidOld,
|
||||
"new_uid" => $participantData["PAR_UID"]
|
||||
);
|
||||
}
|
||||
|
||||
$bwp->addParticipant($participantData);
|
||||
} elseif (! $bwp->isEquals($dataObject, $participantData)) {
|
||||
$bwp->updateParticipant($participantData["PAR_UID"], $participantData);
|
||||
} else {
|
||||
Util\Logger::log("Update Participant ({$participantData["PAR_UID"]}) Skipped - No changes required");
|
||||
}
|
||||
|
||||
$diagram["participant"][$i] = $participantData;
|
||||
$whiteList[] = $participantData["PAR_UID"];
|
||||
}
|
||||
|
||||
$dataCollection = $bwp->getParticipants();
|
||||
|
||||
// looking for removed elements
|
||||
foreach ($dataCollection as $participantData) {
|
||||
if (! in_array($participantData["PAR_UID"], $whiteList)) {
|
||||
// If it is not in the white list, then remove them
|
||||
$bwp->removeParticipant($participantData["PAR_UID"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Diagram's Flows Handling
|
||||
|
||||
@@ -24,6 +24,8 @@ use \BpmnEventPeer as EventPeer;
|
||||
use \BpmnGatewayPeer as GatewayPeer;
|
||||
use \BpmnFlowPeer as FlowPeer;
|
||||
use \BpmnArtifactPeer as ArtifactPeer;
|
||||
use \BpmnParticipant as Participant;
|
||||
use \BpmnParticipantPeer as ParticipantPeer;
|
||||
|
||||
use \BasePeer;
|
||||
|
||||
@@ -73,6 +75,7 @@ class Bpmn extends Handler
|
||||
),
|
||||
"flow" => array("PRJ_UID", "DIA_UID", "FLO_ELEMENT_DEST_PORT", "FLO_ELEMENT_ORIGIN_PORT"),
|
||||
"data" => array("PRJ_UID"),
|
||||
"participant" => array("PRJ_UID"),
|
||||
);
|
||||
|
||||
|
||||
@@ -872,6 +875,87 @@ class Bpmn extends Handler
|
||||
}
|
||||
//////2222
|
||||
|
||||
public function addParticipant($data)
|
||||
{
|
||||
// setting defaults
|
||||
$data['PAR_UID'] = array_key_exists('PAR_UID', $data) ? $data['PAR_UID'] : Common::generateUID();
|
||||
try {
|
||||
self::log("Add Participant with data: ", $data);
|
||||
$participant = new Participant();
|
||||
$participant->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
$participant->setPrjUid($this->getUid());
|
||||
$participant->setProUid($this->getProcess("object")->getProUid());
|
||||
$participant->save();
|
||||
self::log("Add Participant Success!");
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $participant->getParUid();
|
||||
}
|
||||
|
||||
public function updateParticipant($parUid, $data)
|
||||
{
|
||||
try {
|
||||
self::log("Update Participant: $parUid", "With data: ", $data);
|
||||
|
||||
$participant = ParticipantPeer::retrieveByPk($parUid);
|
||||
|
||||
$participant->fromArray($data);
|
||||
$participant->save();
|
||||
|
||||
self::log("Update Participant Success!");
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function getParticipant($parUid, $retType = 'array')
|
||||
{
|
||||
$participant = ParticipantPeer::retrieveByPK($parUid);
|
||||
|
||||
if ($retType != "object" && ! empty($participant)) {
|
||||
$participant = $participant->toArray();
|
||||
$participant = self::filterArrayKeys($participant, self::$excludeFields["participant"]);
|
||||
}
|
||||
|
||||
return $participant;
|
||||
}
|
||||
|
||||
public function getParticipants($start = null, $limit = null, $filter = '', $changeCaseTo = CASE_UPPER)
|
||||
{
|
||||
if (is_array($start)) {
|
||||
extract($start);
|
||||
}
|
||||
|
||||
$filter = $changeCaseTo != CASE_UPPER ? array_map("strtolower", self::$excludeFields["participant"]) : self::$excludeFields["participant"];
|
||||
|
||||
return self::filterCollectionArrayKeys(
|
||||
Participant::getAll($this->getUid(), $start, $limit, $filter, $changeCaseTo),
|
||||
$filter
|
||||
);
|
||||
}
|
||||
|
||||
public function removeParticipant($parUid)
|
||||
{
|
||||
try {
|
||||
self::log("Remove Participant: $parUid");
|
||||
|
||||
$participant = ParticipantPeer::retrieveByPK($parUid);
|
||||
$participant->delete();
|
||||
|
||||
// remove related object (flows)
|
||||
Flow::removeAllRelated($parUid);
|
||||
|
||||
self::log("Remove Participant Success!");
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function addLane($data)
|
||||
{
|
||||
// TODO: Implement update() method.
|
||||
|
||||
@@ -92,5 +92,25 @@ class DynaForm extends Api
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /:prj_uid/dynaform/:dyn_uid/fields
|
||||
*
|
||||
* @param string $dyn_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
*/
|
||||
public function doGetDynaFormFields($dyn_uid, $prj_uid)
|
||||
{
|
||||
try {
|
||||
$dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
|
||||
$dynaForm->setFormatFieldNameInUppercase(false);
|
||||
|
||||
$response = $dynaForm->getDynaFormFields($prj_uid, $dyn_uid);
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,342 +6,32 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
|
||||
<link rel='stylesheet' type='text/css' href='/css/neoclassic-blank.css' />
|
||||
|
||||
<link rel="stylesheet" href="/lib/pmdynaform/libs/bootstrap-3.1.1/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/lib/pmdynaform/build/css/PMDynaform.css">
|
||||
|
||||
<!--<script type="text/javascript" src="/js/maborak/core/maborak.js"></script>-->
|
||||
<script type="text/javascript" src="/lib/pmdynaform/libs/jquery/jquery-1.11.js"></script>
|
||||
<script type="text/javascript" src="/lib/pmdynaform/libs/jquery/jquery.inputmask.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/lib/pmdynaform/libs/bootstrap-3.1.1/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="/lib/pmdynaform/libs/underscore/underscore-1.6.js"></script>
|
||||
<script type="text/javascript" src="/lib/pmdynaform/libs/backbone/backbone-min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/lib/pmdynaform/libs/backbone/backbone-min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
<script type="text/template" id="fieldset-template">
|
||||
<fieldset>
|
||||
<legend>Options</legend>
|
||||
|
||||
<div class='col-sm-12'>
|
||||
<div class='form-group'>
|
||||
<label for="user_locale">Language</label>
|
||||
<select class="form-control" id="user_locale" name="user[locale]"><option value="de" selected="selected">Deutsch</option>
|
||||
<option value="en">English</option></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-exoinput">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Email address</label>
|
||||
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-panelfield">
|
||||
<div class="col-xs-<%- colSpan %>">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-row">
|
||||
<div class="row show-grid">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-validator">
|
||||
<ul>
|
||||
|
||||
<% for (var item in message) {%>
|
||||
<li><span><%= message[item]%> </span></li>
|
||||
<%}%>
|
||||
</ul>
|
||||
</script>
|
||||
<script type="text/template" id="tpl-datetime">
|
||||
<div class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%>">
|
||||
<div class="input-append date">
|
||||
<label class="col-lg-<%=colSpanLabel%> control-label">
|
||||
<span><%= label %></span>
|
||||
<%if(required){%>
|
||||
<span class="pmdynaform-field-required">*</span>
|
||||
<%}%>
|
||||
</label>
|
||||
<div class="col-lg-<%=colSpanControl%>">
|
||||
<div class="input-group">
|
||||
<input class="form-control" data-format="<%=format%>" type="text"></input>
|
||||
<span class=" input-group-addon add-on">
|
||||
<i data-time-icon="icon-time" data-date-icon="icon-calendar">
|
||||
</i>
|
||||
</span>
|
||||
<%if (hint !== "" && hint !== null){%>
|
||||
<span class="glyphicon glyphicon-question-sign " data-toggle="tooltip" data-placement="bottom" title="<%=hint%>"></span>
|
||||
<%}%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/template" id="tpl-date">
|
||||
<div class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%>">
|
||||
<div class="input-append date">
|
||||
<label class="col-lg-<%=colSpanLabel%> control-label">
|
||||
<span><%= label %></span>
|
||||
<%if(required){%>
|
||||
<span class="pmdynaform-field-required">*</span>
|
||||
<%}%>
|
||||
</label>
|
||||
<div class="col-lg-<%=colSpanControl%>">
|
||||
<div class="input-group">
|
||||
<input class="form-control" data-format="<%=format%>" type="text"></input>
|
||||
<span class=" input-group-addon add-on">
|
||||
<i data-time-icon="icon-time" data-date-icon="icon-calendar">
|
||||
</i>
|
||||
</span>
|
||||
<%if (hint !== "" && hint !== null){%>
|
||||
<span class="glyphicon glyphicon-question-sign " data-toggle="tooltip" data-placement="bottom" title="<%=hint%>"></span>
|
||||
<%}%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/template" id="tpl-time">
|
||||
<div class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%>">
|
||||
<div class="input-append date">
|
||||
<label class="col-lg-<%=colSpanLabel%> control-label">
|
||||
<span><%= label %></span>
|
||||
<%if(required){%>
|
||||
<span class="pmdynaform-field-required">*</span>
|
||||
<%}%>
|
||||
</label>
|
||||
<div class="col-lg-<%=colSpanControl%>">
|
||||
<div class="input-group">
|
||||
<input class="form-control" data-format="<%=format%>" type="text"></input>
|
||||
<span class=" input-group-addon add-on">
|
||||
<i data-time-icon="icon-time" data-date-icon="icon-calendar">
|
||||
</i>
|
||||
</span>
|
||||
<%if (hint !== "" && hint !== null){%>
|
||||
<span class="glyphicon glyphicon-question-sign " data-toggle="tooltip" data-placement="bottom" title="<%=hint%>"></span>
|
||||
<%}%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-text">
|
||||
<div id="<%=id%>" class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%>">
|
||||
<label class="col-lg-<%=colSpanLabel%> control-label">
|
||||
<span><%= label %></span>
|
||||
<%if(required){%>
|
||||
<span class="pmdynaform-field-required">*</span>
|
||||
<%}%>
|
||||
</label>
|
||||
<div class="col-lg-<%=colSpanControl%>">
|
||||
<input type=<%=type%>
|
||||
class="form-control"
|
||||
placeholder= "<%= placeholder %>"
|
||||
value= "<%= value%>"
|
||||
<% if(typeof maxLength === "number"){%>
|
||||
maxlength="<%= maxLength%>"
|
||||
<% }%>
|
||||
<% if(disabled === true){%>disabled<%}%>
|
||||
autocomplete="off"
|
||||
>
|
||||
<% if(!valid){%>
|
||||
<span class="glyphicon glyphicon-remove form-control-feedback"></span>
|
||||
<%}%>
|
||||
<%if (hint !== "" && hint !== null){%>
|
||||
<span class="glyphicon glyphicon-question-sign " data-toggle="tooltip" data-placement="bottom" title="<%=hint%>"></span>
|
||||
<%}%>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script type="text/template" id="tpl-textarea">
|
||||
<div class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%>">
|
||||
<label class="col-lg-<%=colSpanLabel%> control-label">
|
||||
<span><%= label %></span>
|
||||
<%if(required){%>
|
||||
<span class="pmdynaform-field-required">*</span>
|
||||
<%}%>
|
||||
</label>
|
||||
<div class="col-lg-<%=colSpanControl%>">
|
||||
<textarea class="form-control"
|
||||
rows="<%= rows %>"
|
||||
value="<%= value %>"
|
||||
></textarea>
|
||||
<%if (hint !== "" && hint !== null){%>
|
||||
<span class="glyphicon glyphicon-question-sign " data-toggle="tooltip" data-placement="bottom" title="<%=hint%>"></span>
|
||||
<%}%>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-checkbox">
|
||||
<div class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%>">
|
||||
<label class="col-lg-<%=colSpanLabel%> control-label">
|
||||
<span><%= label %></span>
|
||||
<%if(required){%>
|
||||
<span class="pmdynaform-field-required">*</span>
|
||||
<%}%>
|
||||
</label>
|
||||
<div class="col-lg-<%=colSpanControl%>">
|
||||
<div class="pmdynaform-checkbox-items">
|
||||
<% for(var option in options) { %>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input
|
||||
value="<%=options[option].value%>"
|
||||
type="<%=type%>"
|
||||
<% if(options[option].selected){%>checked<%}%>>
|
||||
<span><%= options[option].label %> </span>
|
||||
</label>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<%if (hint !== "" && hint !== null){%>
|
||||
<span class="glyphicon glyphicon-question-sign " data-toggle="tooltip" data-placement="bottom" title="<%=hint%>"></span>
|
||||
<%}%>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/template" id="tpl-radio">
|
||||
<div class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%>">
|
||||
<label class="col-lg-<%=colSpanLabel%> control-label">
|
||||
<span><%= label %></span>
|
||||
<%if(required){%>
|
||||
<span class="pmdynaform-field-required">*</span>
|
||||
<%}%>
|
||||
</label>
|
||||
<div class="col-lg-<%=colSpanControl%>">
|
||||
<div class="pmdynaform-radio-items">
|
||||
<% for(var option in options) { %>
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input name="<%=name%>"
|
||||
value="<%=options[option].value%>"
|
||||
type="<%=type%>">
|
||||
<span><%= options[option].label %> </span>
|
||||
</label>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<%if (hint !== "" && hint !== null){%>
|
||||
<span class="glyphicon glyphicon-question-sign " data-toggle="tooltip" data-placement="bottom" title="<%=hint%>"></span>
|
||||
<%}%>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script type="text/template" id="tpl-dropdown">
|
||||
<div class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%>">
|
||||
<label class="col-lg-<%=colSpanLabel%> control-label">
|
||||
<span><%= label %></span>
|
||||
<%if(required){%>
|
||||
<span class="pmdynaform-field-required">*</span>
|
||||
<%}%>
|
||||
</label>
|
||||
<div class="col-lg-<%=colSpanControl%>">
|
||||
<select class="form-control">
|
||||
<% for(var option in options) { %>
|
||||
<option value=<%= options[option].value %>><%= options[option].label %></option>
|
||||
<% } %>
|
||||
</select>
|
||||
<%if (hint !== "" && hint !== null){%>
|
||||
<span class="glyphicon glyphicon-question-sign " data-toggle="tooltip" data-placement="bottom" title="<%=hint%>"></span>
|
||||
<%}%>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-button">
|
||||
<div id="<%=id%>" class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%> text-center">
|
||||
<button type=<%=type%> class="btn btn-primary"> <span> <%= label %> </span></button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-submit">
|
||||
<div class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%> text-center">
|
||||
<button type=<%=type%> class="btn btn-default"> <span> <%= label %> </span></button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-file">
|
||||
<label for="exampleInputFile">
|
||||
<span><%= label %></span>
|
||||
<%if(required){%>
|
||||
<span class="pmdynaform-field-required">*</span>
|
||||
<%}%>
|
||||
</label>
|
||||
<input type="file" id="exampleInputFile">
|
||||
<%if (hint !== "" && hint !== null){%>
|
||||
<span class="glyphicon glyphicon-question-sign " data-toggle="tooltip" data-placement="bottom" title="<%=hint%>"></span>
|
||||
<%}%>
|
||||
<p class="help-block">Example block-level help text here.</p>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-suggest-list">
|
||||
<div class="list-group col-sm-12 col-md-12 col-lg-12 col-xs-12 pmdynaform-suggest">
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/template" id="tpl-suggest-element">
|
||||
<span class="list-group-item"><%= value %></span>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-link">
|
||||
<div id="<%=id%>" class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%> col-xs-<%=colSpan%>">
|
||||
<label class="col-lg-<%=colSpanLabel%> control-label">
|
||||
<span><%= label %></span>
|
||||
<%if(required){%>
|
||||
<span class="pmdynaform-field-required">*</span>
|
||||
<%}%>
|
||||
</label>
|
||||
<div class="col-lg-<%=colSpanControl%>">
|
||||
<button type="button" class="btn btn-link"> <span> <%= name %> </span></button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="tpl-empty">
|
||||
<div class="form-group col-sm-<%=colSpan%> col-md-<%=colSpan%> col-lg-<%=colSpan%>">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
###TEMPLATES###
|
||||
<script type="text/javascript" src="/lib/pmdynaform/build/js/PMDynaform.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var jsondata = '{JSON_DATA}';
|
||||
var pm_run_outside_main_app = '{PM_RUN_OUTSIDE_MAIN_APP}';
|
||||
var dyn_uid = '{DYN_UID}';
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="/jscore/cases/core/cases_Step.js"></script>
|
||||
<script type="text/javascript" src="/jscore/cases/core/cases_Step_Pmdynaform.js"></script>
|
||||
|
||||
<table width="100%" align="center">
|
||||
<tr class="userGroupTitle">
|
||||
<td width="100%" align="center">{CASE} #: {APP_NUMBER} {TITLE}: {APP_TITLE}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a style="float: left; margin: 10px 2px 2px 10px; cursor: pointer; opacity: 1;"><img src="/lib/img/pager-previous-icon.png" style="padding-right:5px;width:25px;height:20px;">Previous Step</a>
|
||||
<a style="float: right; margin: 10px 10px 2px 2px; cursor: pointer; opacity: 1;">Next step<img src="/lib/img/pager-next-icon.png" style="padding-left:5px;width:25px;height:20px;"></a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>PMDynaform</title>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel='stylesheet' type='text/css' href='/css/neoclassic-blank.css' />
|
||||
<link rel="stylesheet" href="/lib/pmdynaform/libs/bootstrap-3.1.1/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/lib/pmdynaform/build/css/PMDynaform.css">
|
||||
<script type="text/javascript" src="/lib/pmdynaform/libs/jquery/jquery-1.11.js"></script>
|
||||
<script type="text/javascript" src="/lib/pmdynaform/libs/jquery/jquery.inputmask.js"></script>
|
||||
<script type="text/javascript" src="/lib/pmdynaform/libs/bootstrap-3.1.1/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="/lib/pmdynaform/libs/underscore/underscore-1.6.js"></script>
|
||||
<script type="text/javascript" src="/lib/pmdynaform/libs/backbone/backbone-min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
###TEMPLATES###
|
||||
<script type="text/javascript" src="/lib/pmdynaform/build/js/PMDynaform.js"></script>
|
||||
<a style="float: left; margin: 10px 2px 2px 10px; cursor: pointer; opacity: 1;"><img src="/lib/img/pager-previous-icon.png" style="padding-right:5px;width:25px;height:20px;">Previous Step</a>
|
||||
<a style="float: right; margin: 10px 10px 2px 2px; cursor: pointer; opacity: 1;">Next step<img src="/lib/img/pager-next-icon.png" style="padding-left:5px;width:25px;height:20px;"></a>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user