Merged in paulis/processmaker/PM-1588 (pull request #1441)
I corrected the observation about the unused code
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -150,7 +150,7 @@ class Dynaform extends BaseDynaform
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function create ($aData)
|
||||
public function create ($aData, $pmTableUid='')
|
||||
{
|
||||
if (! isset( $aData['PRO_UID'] )) {
|
||||
throw (new PropelException( 'The dynaform cannot be created. The PRO_UID is empty.' ));
|
||||
@@ -194,6 +194,17 @@ class Dynaform extends BaseDynaform
|
||||
}
|
||||
|
||||
$con->commit();
|
||||
|
||||
//Add Audit Log
|
||||
$mode = isset($aData['MODE'])? $aData['MODE'] : 'Determined by Fields';
|
||||
$description = "";
|
||||
if($pmTableUid!=''){
|
||||
$pmTable = AdditionalTablesPeer::retrieveByPK( $pmTableUid );
|
||||
$addTabName = $pmTable->getAddTabName();
|
||||
$description = "Create from a PM Table: ".$addTabName.", ";
|
||||
}
|
||||
G::auditLog("CreateDynaform", $description."Dynaform Title: ".$aData['DYN_TITLE'].", Type: ".$aData['DYN_TYPE'].", Description: ".$aData['DYN_DESCRIPTION'].", Mode: ".$mode);
|
||||
|
||||
$sXml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||
$sXml .= '<dynaForm type="' . $this->getDynType() . '" name="' . $this->getProUid() . '/' . $this->getDynUid() . '" width="500" enabletemplate="0" mode="" nextstepsave="prompt">' . "\n";
|
||||
$sXml .= '</dynaForm>';
|
||||
@@ -232,7 +243,7 @@ class Dynaform extends BaseDynaform
|
||||
|
||||
public function createFromPMTable ($aData, $pmTableUid)
|
||||
{
|
||||
$this->create( $aData );
|
||||
$this->create( $aData , $pmTableUid);
|
||||
$aData['DYN_UID'] = $this->getDynUid();
|
||||
//krumo(BasePeer::getFieldnames('Content'));
|
||||
$fields = array ();
|
||||
@@ -591,9 +602,17 @@ class Dynaform extends BaseDynaform
|
||||
try {
|
||||
$oPro = DynaformPeer::retrieveByPK( $ProUid );
|
||||
if (! is_null( $oPro )) {
|
||||
$title = $oPro->getDynTitle();
|
||||
$type = $oPro->getDynType();
|
||||
$description = $oPro->getDynDescription();
|
||||
|
||||
Content::removeContent( 'DYN_TITLE', '', $oPro->getDynUid() );
|
||||
Content::removeContent( 'DYN_DESCRIPTION', '', $oPro->getDynUid() );
|
||||
$iResult = $oPro->delete();
|
||||
|
||||
//Add Audit Log
|
||||
G::auditLog("DeleteDynaform", "Dynaform Title: ".$title.", Type: ".$type.", Description: ".$description);
|
||||
|
||||
if (file_exists( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.xml' )) {
|
||||
unlink( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.xml' );
|
||||
}
|
||||
|
||||
@@ -116,6 +116,14 @@ try {
|
||||
$_POST['FCD_UID'] = ($_POST['FCD_UID'] == '0') ? '' : $_POST['FCD_UID'];
|
||||
$aData = Array ('FCD_UID' => Isset( $_POST['FCD_UID'] ) ? $_POST['FCD_UID'] : '','FCD_FUNCTION' => $_POST['function'],'FCD_FIELDS' => $_POST['fields_selected'],'FCD_CONDITION' => $_POST['condition'],'FCD_EVENTS' => $_POST['events'],'FCD_EVENT_OWNERS' => $_POST['event_owner_selected'],'FCD_STATUS' => $_POST['enabled'],'FCD_DYN_UID' => $aDYN['DYN_UID']);
|
||||
$oFieldCondition->quickSave( $aData );
|
||||
//Add Audit Log
|
||||
if(isset($_POST['enabled']) && $_POST['enabled'] == 1){
|
||||
$enable = 'enable';
|
||||
}else{
|
||||
$enable = 'disable';
|
||||
}
|
||||
G::auditLog("ConditionsEditorDynaform", "Dynaform Title: " .$aDYN['DYNAFORM_NAME']. ", Condition Editor: [Function: ".$_POST['function']. ", Fields: ".$_POST['fields_selected']. ", Conditions: ".$_POST['condition']. ", Events: ".$_POST['events']. ", Event Owner: ".$_POST['event_owner_selected']. ", Status: ".$enable."]");
|
||||
|
||||
break;
|
||||
case 'delete':
|
||||
require_once 'classes/model/FieldCondition.php';
|
||||
|
||||
Reference in New Issue
Block a user