Merged in darojas/processmaker (pull request #555)
Se adiciona campo dyn_content para end points de dynaform
This commit is contained in:
@@ -73,6 +73,8 @@ class DynaformMapBuilder
|
||||
|
||||
$tMap->addColumn('DYN_FILENAME', 'DynFilename', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addColumn('DYN_CONTENT', 'DynContent', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||
|
||||
$tMap->addValidator('DYN_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'xmlform|grid', 'Please select a valid dynaform type.');
|
||||
|
||||
} // doBuild()
|
||||
|
||||
@@ -51,6 +51,12 @@ abstract class BaseDynaform extends BaseObject implements Persistent
|
||||
*/
|
||||
protected $dyn_filename = '';
|
||||
|
||||
/**
|
||||
* The value for the dyn_content field.
|
||||
* @var string
|
||||
*/
|
||||
protected $dyn_content;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
@@ -109,6 +115,17 @@ abstract class BaseDynaform extends BaseObject implements Persistent
|
||||
return $this->dyn_filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [dyn_content] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDynContent()
|
||||
{
|
||||
|
||||
return $this->dyn_content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [dyn_uid] column.
|
||||
*
|
||||
@@ -197,6 +214,28 @@ abstract class BaseDynaform extends BaseObject implements Persistent
|
||||
|
||||
} // setDynFilename()
|
||||
|
||||
/**
|
||||
* Set the value of [dyn_content] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setDynContent($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->dyn_content !== $v) {
|
||||
$this->dyn_content = $v;
|
||||
$this->modifiedColumns[] = DynaformPeer::DYN_CONTENT;
|
||||
}
|
||||
|
||||
} // setDynContent()
|
||||
|
||||
/**
|
||||
* Hydrates (populates) the object variables with values from the database resultset.
|
||||
*
|
||||
@@ -222,12 +261,14 @@ abstract class BaseDynaform extends BaseObject implements Persistent
|
||||
|
||||
$this->dyn_filename = $rs->getString($startcol + 3);
|
||||
|
||||
$this->dyn_content = $rs->getString($startcol + 4);
|
||||
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
||||
// FIXME - using NUM_COLUMNS may be clearer.
|
||||
return $startcol + 4; // 4 = DynaformPeer::NUM_COLUMNS - DynaformPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 5; // 5 = DynaformPeer::NUM_COLUMNS - DynaformPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating Dynaform object", $e);
|
||||
@@ -443,6 +484,9 @@ abstract class BaseDynaform extends BaseObject implements Persistent
|
||||
case 3:
|
||||
return $this->getDynFilename();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getDynContent();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -467,6 +511,7 @@ abstract class BaseDynaform extends BaseObject implements Persistent
|
||||
$keys[1] => $this->getProUid(),
|
||||
$keys[2] => $this->getDynType(),
|
||||
$keys[3] => $this->getDynFilename(),
|
||||
$keys[4] => $this->getDynContent(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
@@ -510,6 +555,9 @@ abstract class BaseDynaform extends BaseObject implements Persistent
|
||||
case 3:
|
||||
$this->setDynFilename($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setDynContent($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -549,6 +597,10 @@ abstract class BaseDynaform extends BaseObject implements Persistent
|
||||
$this->setDynFilename($arr[$keys[3]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[4], $arr)) {
|
||||
$this->setDynContent($arr[$keys[4]]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -576,6 +628,10 @@ abstract class BaseDynaform extends BaseObject implements Persistent
|
||||
$criteria->add(DynaformPeer::DYN_FILENAME, $this->dyn_filename);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(DynaformPeer::DYN_CONTENT)) {
|
||||
$criteria->add(DynaformPeer::DYN_CONTENT, $this->dyn_content);
|
||||
}
|
||||
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -636,6 +692,8 @@ abstract class BaseDynaform extends BaseObject implements Persistent
|
||||
|
||||
$copyObj->setDynFilename($this->dyn_filename);
|
||||
|
||||
$copyObj->setDynContent($this->dyn_content);
|
||||
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ abstract class BaseDynaformPeer
|
||||
const CLASS_DEFAULT = 'classes.model.Dynaform';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 4;
|
||||
const NUM_COLUMNS = 5;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
@@ -43,6 +43,9 @@ abstract class BaseDynaformPeer
|
||||
/** the column name for the DYN_FILENAME field */
|
||||
const DYN_FILENAME = 'DYNAFORM.DYN_FILENAME';
|
||||
|
||||
/** the column name for the DYN_CONTENT field */
|
||||
const DYN_CONTENT = 'DYNAFORM.DYN_CONTENT';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
@@ -54,10 +57,10 @@ abstract class BaseDynaformPeer
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DynUid', 'ProUid', 'DynType', 'DynFilename', ),
|
||||
BasePeer::TYPE_COLNAME => array (DynaformPeer::DYN_UID, DynaformPeer::PRO_UID, DynaformPeer::DYN_TYPE, DynaformPeer::DYN_FILENAME, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('DYN_UID', 'PRO_UID', 'DYN_TYPE', 'DYN_FILENAME', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DynUid', 'ProUid', 'DynType', 'DynFilename', 'DynContent', ),
|
||||
BasePeer::TYPE_COLNAME => array (DynaformPeer::DYN_UID, DynaformPeer::PRO_UID, DynaformPeer::DYN_TYPE, DynaformPeer::DYN_FILENAME, DynaformPeer::DYN_CONTENT, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('DYN_UID', 'PRO_UID', 'DYN_TYPE', 'DYN_FILENAME', 'DYN_CONTENT', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -67,10 +70,10 @@ abstract class BaseDynaformPeer
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DynUid' => 0, 'ProUid' => 1, 'DynType' => 2, 'DynFilename' => 3, ),
|
||||
BasePeer::TYPE_COLNAME => array (DynaformPeer::DYN_UID => 0, DynaformPeer::PRO_UID => 1, DynaformPeer::DYN_TYPE => 2, DynaformPeer::DYN_FILENAME => 3, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('DYN_UID' => 0, 'PRO_UID' => 1, 'DYN_TYPE' => 2, 'DYN_FILENAME' => 3, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DynUid' => 0, 'ProUid' => 1, 'DynType' => 2, 'DynFilename' => 3, 'DynContent' => 4, ),
|
||||
BasePeer::TYPE_COLNAME => array (DynaformPeer::DYN_UID => 0, DynaformPeer::PRO_UID => 1, DynaformPeer::DYN_TYPE => 2, DynaformPeer::DYN_FILENAME => 3, DynaformPeer::DYN_CONTENT => 4, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('DYN_UID' => 0, 'PRO_UID' => 1, 'DYN_TYPE' => 2, 'DYN_FILENAME' => 3, 'DYN_CONTENT' => 4, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -179,6 +182,8 @@ abstract class BaseDynaformPeer
|
||||
|
||||
$criteria->addSelectColumn(DynaformPeer::DYN_FILENAME);
|
||||
|
||||
$criteria->addSelectColumn(DynaformPeer::DYN_CONTENT);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(DYNAFORM.DYN_UID)';
|
||||
|
||||
@@ -348,8 +348,8 @@ abstract class BaseHolidayPeer
|
||||
$criteria = $values->buildCriteria(); // build Criteria from Holiday object
|
||||
}
|
||||
|
||||
$criteria->remove(HolidayPeer::HLD_UID); // remove pkey col since this table uses auto-increment
|
||||
|
||||
//$criteria->remove(HolidayPeer::HLD_UID); // remove pkey col since this table uses auto-increment
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
@@ -151,7 +151,7 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent
|
||||
* The value for the out_doc_open_type field.
|
||||
* @var int
|
||||
*/
|
||||
protected $out_doc_open_type = 0;
|
||||
protected $out_doc_open_type = 1;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
@@ -853,7 +853,7 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->out_doc_open_type !== $v || $v === 0) {
|
||||
if ($this->out_doc_open_type !== $v || $v === 1) {
|
||||
$this->out_doc_open_type = $v;
|
||||
$this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_OPEN_TYPE;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
|
||||
* The value for the we_data field.
|
||||
* @var string
|
||||
*/
|
||||
protected $we_data = '';
|
||||
protected $we_data;
|
||||
|
||||
/**
|
||||
* The value for the we_create_usr_uid field.
|
||||
@@ -456,7 +456,7 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->we_data !== $v || $v === '') {
|
||||
if ($this->we_data !== $v) {
|
||||
$this->we_data = $v;
|
||||
$this->modifiedColumns[] = WebEntryPeer::WE_DATA;
|
||||
}
|
||||
|
||||
@@ -458,6 +458,7 @@
|
||||
<column name="PRO_UID" type="VARCHAR" size="32" required="true" default="0"/>
|
||||
<column name="DYN_TYPE" type="VARCHAR" size="20" required="true" default="xmlform"/>
|
||||
<column name="DYN_FILENAME" type="VARCHAR" size="100" required="true" default=""/>
|
||||
<column name="DYN_CONTENT" type="LONGVARCHAR"/>
|
||||
<validator column="DYN_TYPE">
|
||||
<rule name="validValues" value="xmlform|grid" message="Please select a valid dynaform type."/>
|
||||
</validator>
|
||||
|
||||
@@ -204,6 +204,7 @@ CREATE TABLE `DYNAFORM`
|
||||
`PRO_UID` VARCHAR(32) default '0' NOT NULL,
|
||||
`DYN_TYPE` VARCHAR(20) default 'xmlform' NOT NULL,
|
||||
`DYN_FILENAME` VARCHAR(100) default '' NOT NULL,
|
||||
`DYN_CONTENT` MEDIUMTEXT,
|
||||
PRIMARY KEY (`DYN_UID`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Forms required';
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@@ -367,6 +367,10 @@ class DynaForm
|
||||
|
||||
$dynaFormUid = $dynaForm->create($arrayData);
|
||||
|
||||
$oDynaform = \DynaformPeer::retrieveByPK( $dynaFormUid );
|
||||
$oDynaform->setDynContent( $arrayData['DYN_CONTENT'] );
|
||||
$oDynaform->save();
|
||||
|
||||
//Return
|
||||
unset($arrayData["PRO_UID"]);
|
||||
|
||||
@@ -907,6 +911,7 @@ class DynaForm
|
||||
$criteria->addAsColumn("DYN_TITLE", "CT.CON_VALUE");
|
||||
$criteria->addAsColumn("DYN_DESCRIPTION", "CD.CON_VALUE");
|
||||
$criteria->addSelectColumn(\DynaformPeer::DYN_TYPE);
|
||||
$criteria->addSelectColumn(\DynaformPeer::DYN_CONTENT);
|
||||
|
||||
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
|
||||
$criteria->addAlias("CD", \ContentPeer::TABLE_NAME);
|
||||
@@ -953,7 +958,8 @@ class DynaForm
|
||||
$this->getFieldNameByFormatFieldName("DYN_UID") => $record["DYN_UID"],
|
||||
$this->getFieldNameByFormatFieldName("DYN_TITLE") => $record["DYN_TITLE"],
|
||||
$this->getFieldNameByFormatFieldName("DYN_DESCRIPTION") => $record["DYN_DESCRIPTION"] . "",
|
||||
$this->getFieldNameByFormatFieldName("DYN_TYPE") => $record["DYN_TYPE"] . ""
|
||||
$this->getFieldNameByFormatFieldName("DYN_TYPE") => $record["DYN_TYPE"] . "",
|
||||
$this->getFieldNameByFormatFieldName("DYN_CONTENT") => $record["DYN_CONTENT"] . ""
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
|
||||
@@ -152,15 +152,15 @@ class Bpmn extends Handler
|
||||
}
|
||||
|
||||
self::log("Remove Project With Uid: {$this->prjUid}");
|
||||
foreach ($this->getEvents() as $event) {
|
||||
$this->removeEvent($event["EVN_UID"]);
|
||||
}
|
||||
foreach ($this->getActivities() as $activity) {
|
||||
$this->removeActivity($activity["ACT_UID"]);
|
||||
}
|
||||
foreach ($this->getGateways() as $gateway) {
|
||||
$this->removeGateway($gateway["GAT_UID"]);
|
||||
}
|
||||
foreach ($this->getEvents() as $event) {
|
||||
$this->removeEvent($event["EVN_UID"]);
|
||||
}
|
||||
foreach ($this->getFlows() as $flow) {
|
||||
$this->removeFlow($flow["FLO_UID"]);
|
||||
}
|
||||
@@ -483,8 +483,8 @@ class Bpmn extends Handler
|
||||
{
|
||||
try {
|
||||
self::log("Remove Event: $evnUid");
|
||||
|
||||
$event = EventPeer::retrieveByPK($evnUid);
|
||||
|
||||
$event->delete();
|
||||
|
||||
self::log("Remove Event Success!");
|
||||
|
||||
Reference in New Issue
Block a user