Merge branch 'master' of bitbucket.org:colosa/processmaker

This commit is contained in:
Wendy Nestor
2014-06-27 16:43:57 -04:00
5 changed files with 93 additions and 8 deletions

View File

@@ -170,6 +170,10 @@ class Dynaform extends BaseDynaform
$this->setDynType( isset( $aData['DYN_TYPE'] ) ? $aData['DYN_TYPE'] : 'xmlform' );
$this->setDynFilename( $aData['PRO_UID'] . PATH_SEP . $dynUid );
if (isset($aData["DYN_CONTENT"])) {
$this->setDynContent($aData["DYN_CONTENT"]);
}
if ($this->validate()) {
$con->begin();
$res = $this->save();

View File

@@ -8,7 +8,8 @@ class DynaForm
"DYN_TITLE" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "dynaFormTitle"),
"DYN_DESCRIPTION" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "dynaFormDescription"),
"DYN_TYPE" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array("xmlform", "grid"), "fieldNameAux" => "dynaFormType")
"DYN_TYPE" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array("xmlform", "grid"), "fieldNameAux" => "dynaFormType"),
"DYN_CONTENT" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "dynaFormContent")
);
private $formatFieldNameInUppercase = true;
@@ -367,10 +368,6 @@ class DynaForm
$dynaFormUid = $dynaForm->create($arrayData);
$oDynaform = \DynaformPeer::retrieveByPK( $dynaFormUid );
$oDynaform->setDynContent( $arrayData['DYN_CONTENT'] );
$oDynaform->save();
//Return
unset($arrayData["PRO_UID"]);
@@ -959,7 +956,7 @@ class DynaForm
$this->getFieldNameByFormatFieldName("DYN_TITLE") => $record["DYN_TITLE"],
$this->getFieldNameByFormatFieldName("DYN_DESCRIPTION") => $record["DYN_DESCRIPTION"] . "",
$this->getFieldNameByFormatFieldName("DYN_TYPE") => $record["DYN_TYPE"] . "",
$this->getFieldNameByFormatFieldName("DYN_CONTENT") => $record["DYN_CONTENT"] . ""
$this->getFieldNameByFormatFieldName("DYN_CONTENT") => $record["DYN_CONTENT"] . ""
);
} catch (\Exception $e) {
throw $e;

View File

@@ -136,6 +136,68 @@ class InputDocument
}
}
/**
* Verify if the InputDocument it's assigned in other objects
*
* @param string $inputDocumentUid Unique id of InputDocument
*
* return array Return array (true if it's assigned or false otherwise and data)
*/
public function itsAssignedInOtherObjects($inputDocumentUid)
{
try {
$flagAssigned = false;
$arrayData = array();
//Step
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\StepPeer::STEP_UID);
$criteria->add(\StepPeer::STEP_TYPE_OBJ, "INPUT_DOCUMENT", \Criteria::EQUAL);
$criteria->add(\StepPeer::STEP_UID_OBJ, $inputDocumentUid, \Criteria::EQUAL);
$rsCriteria = \StepPeer::doSelectRS($criteria);
if ($rsCriteria->next()) {
$flagAssigned = true;
$arrayData[] = \G::LoadTranslation("ID_STEPS");
}
//StepSupervisor
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\StepSupervisorPeer::STEP_UID);
$criteria->add(\StepSupervisorPeer::STEP_TYPE_OBJ, "INPUT_DOCUMENT", \Criteria::EQUAL);
$criteria->add(\StepSupervisorPeer::STEP_UID_OBJ, $inputDocumentUid, \Criteria::EQUAL);
$rsCriteria = \StepSupervisorPeer::doSelectRS($criteria);
if ($rsCriteria->next()) {
$flagAssigned = true;
$arrayData[] = \G::LoadTranslation("ID_CASES_MENU_ADMIN");
}
//ObjectPermission
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ObjectPermissionPeer::OP_UID);
$criteria->add(\ObjectPermissionPeer::OP_OBJ_TYPE, "INPUT", \Criteria::EQUAL);
$criteria->add(\ObjectPermissionPeer::OP_OBJ_UID, $inputDocumentUid, \Criteria::EQUAL);
$rsCriteria = \ObjectPermissionPeer::doSelectRS($criteria);
if ($rsCriteria->next()) {
$flagAssigned = true;
$arrayData[] = \G::LoadTranslation("ID_PROCESS_PERMISSIONS");
}
//Return
return array($flagAssigned, $arrayData);
} catch (\Exception $e) {
throw $e;
}
}
/**
* Verify if doesn't exists the InputDocument in table INPUT_DOCUMENT
*
@@ -189,6 +251,27 @@ class InputDocument
}
}
/**
* Verify if the InputDocument it's assigned in other objects
*
* @param string $inputDocumentUid Unique id of InputDocument
* @param string $fieldNameForException Field name for the exception
*
* return void Throw exception if the InputDocument it's assigned in other objects
*/
public function throwExceptionIfItsAssignedInOtherObjects($inputDocumentUid, $fieldNameForException)
{
try {
list($flagAssigned, $arrayData) = $this->itsAssignedInOtherObjects($inputDocumentUid);
if ($flagAssigned) {
throw new \Exception(\G::LoadTranslation("ID_INPUT_DOCUMENT_ITS_ASSIGNED", array($fieldNameForException, $inputDocumentUid, implode(", ", $arrayData))));
}
} catch (\Exception $e) {
throw $e;
}
}
/**
* Create InputDocument for a Process
*
@@ -313,6 +396,8 @@ class InputDocument
//Verify data
$this->throwExceptionIfNotExistsInputDocument($inputDocumentUid, "", $this->arrayFieldNameForException["inputDocumentUid"]);
$this->throwExceptionIfItsAssignedInOtherObjects($inputDocumentUid, $this->arrayFieldNameForException["inputDocumentUid"]);
//Delete
//StepSupervisor
$stepSupervisor = new \StepSupervisor();

View File

@@ -68,9 +68,8 @@
<a target="_blank" href="http://www.processmaker.com"><img src="/images/get_started.png" border="0" width="163" height="438"></a>
</td>
<td class="cell2" valign="top">
<span class="cLow"><strong>Get Started</strong></span>
<p><span class="cLow">Welcome to ProcessMaker!</span></p>
<p><span class="cLow">To get started, log in using the following credentials. You can change them later:</span></p>
<p><span class="cLow">To get started, log in using the following credentials. You can change them later:</span></p>
<span class="cNeg">Username:</span><span class="cLow"> {name}</span><br>
<span class="cNeg">Password:</span><span class="cLow"> The password introduced at the time of installing the application</span>
<p><span class="cLow">We suggest you follow our 7 easy videos to automate your workflow. You can see a demo of each step at&nbsp;<a target="_blank" href="http://www.processmaker.com/demos/">http://www.processmaker.com/demos/</a> </span></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 14 KiB