BUG 9286 Comments are deleted from the XML code for DynaForms SOLVED
- ProcessMaker deletes comments from XML code. - Adjustment in the standarized Code.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class.dynaFormField.php
|
* class.dynaFormField.php
|
||||||
*
|
*
|
||||||
@@ -24,8 +25,7 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
G::LoadClass('xmlDb');
|
||||||
G::LoadClass( 'xmlDb' );
|
|
||||||
G::LoadSystem('dynaformhandler');
|
G::LoadSystem('dynaformhandler');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,7 +35,9 @@ G::LoadSystem('dynaformhandler');
|
|||||||
*/
|
*/
|
||||||
class DynaFormField extends DBTable
|
class DynaFormField extends DBTable
|
||||||
{
|
{
|
||||||
|
|
||||||
private $fileName;
|
private $fileName;
|
||||||
|
|
||||||
public function getFileName()
|
public function getFileName()
|
||||||
{
|
{
|
||||||
return $this->fileName;
|
return $this->fileName;
|
||||||
@@ -52,10 +54,10 @@ class DynaFormField extends DBTable
|
|||||||
* @param string $objConnection
|
* @param string $objConnection
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function SetTo ($objConnection)
|
public function SetTo($objConnection)
|
||||||
{
|
{
|
||||||
DBTable::SetTo( $objConnection, 'dynaForm', array ('XMLNODE_NAME'
|
DBTable::SetTo($objConnection, 'dynaForm', array('XMLNODE_NAME'
|
||||||
) );
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,13 +66,13 @@ class DynaFormField extends DBTable
|
|||||||
* @param string $sUID
|
* @param string $sUID
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function Load ($sUID)
|
public function Load($sUID)
|
||||||
{
|
{
|
||||||
parent::Load( $sUID );
|
parent::Load($sUID);
|
||||||
if (is_array( $this->Fields )) {
|
if (is_array($this->Fields)) {
|
||||||
foreach ($this->Fields as $name => $value) {
|
foreach ($this->Fields as $name => $value) {
|
||||||
if (strcasecmp( $name, 'dependentfields' ) == 0) {
|
if (strcasecmp($name, 'dependentfields') == 0) {
|
||||||
$this->Fields[$name] = explode( ',', $value );
|
$this->Fields[$name] = explode(',', $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +84,7 @@ class DynaFormField extends DBTable
|
|||||||
* @param string $uid
|
* @param string $uid
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function Delete ($uid)
|
public function Delete($uid)
|
||||||
{
|
{
|
||||||
$this->Fields['XMLNODE_NAME'] = $uid;
|
$this->Fields['XMLNODE_NAME'] = $uid;
|
||||||
parent::Delete();
|
parent::Delete();
|
||||||
@@ -96,108 +98,28 @@ class DynaFormField extends DBTable
|
|||||||
* @param array $options
|
* @param array $options
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function Save ($Fields, $labels = array(), $options = array())
|
public function Save($Fields, $labels = array(), $options = array())
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($Fields['TYPE'] === 'javascript') {
|
if ($Fields['TYPE'] === 'javascript') {
|
||||||
$Fields['XMLNODE_VALUE'] = $Fields['CODE'];
|
$Fields['XMLNODE_VALUE'] = $Fields['CODE'];
|
||||||
unset( $Fields['CODE'] );
|
unset($Fields['CODE']);
|
||||||
$labels = array ();
|
$labels = array();
|
||||||
}
|
}
|
||||||
if ($Fields['XMLNODE_NAME_OLD'] == '') {
|
if ($Fields['XMLNODE_NAME_OLD'] == '') {
|
||||||
if (($Fields['XMLNODE_NAME'][0] == '1') || ($Fields['XMLNODE_NAME'][0] == '2') || ($Fields['XMLNODE_NAME'][0] == '3') || ($Fields['XMLNODE_NAME'][0] == '4') || ($Fields['XMLNODE_NAME'][0] == '5') || ($Fields['XMLNODE_NAME'][0] == '6') || ($Fields['XMLNODE_NAME'][0] == '7') || ($Fields['XMLNODE_NAME'][0] == '8') || ($Fields['XMLNODE_NAME'][0] == '9') || ($Fields['XMLNODE_NAME'][0] == '10')) {
|
if (($Fields['XMLNODE_NAME'][0] == '1') || ($Fields['XMLNODE_NAME'][0] == '2') || ($Fields['XMLNODE_NAME'][0] == '3') || ($Fields['XMLNODE_NAME'][0] == '4') || ($Fields['XMLNODE_NAME'][0] == '5') || ($Fields['XMLNODE_NAME'][0] == '6') || ($Fields['XMLNODE_NAME'][0] == '7') || ($Fields['XMLNODE_NAME'][0] == '8') || ($Fields['XMLNODE_NAME'][0] == '9') || ($Fields['XMLNODE_NAME'][0] == '10')) {
|
||||||
$Fields['XMLNODE_NAME'] = '_' . $Fields['XMLNODE_NAME'];
|
$Fields['XMLNODE_NAME'] = '_' . $Fields['XMLNODE_NAME'];
|
||||||
}
|
}
|
||||||
$res = $this->_dbses->Execute( 'SELECT * FROM dynaForm WHERE XMLNODE_NAME="' . $Fields['XMLNODE_NAME'] . '"' );
|
$res = $this->_dbses->Execute('SELECT * FROM dynaForm WHERE XMLNODE_NAME="' . $Fields['XMLNODE_NAME'] . '"');
|
||||||
} else {
|
} else {
|
||||||
if (($Fields['XMLNODE_NAME_OLD'][0] == '1') || ($Fields['XMLNODE_NAME_OLD'][0] == '2') || ($Fields['XMLNODE_NAME_OLD'][0] == '3') || ($Fields['XMLNODE_NAME_OLD'][0] == '4') || ($Fields['XMLNODE_NAME_OLD'][0] == '5') || ($Fields['XMLNODE_NAME_OLD'][0] == '6') || ($Fields['XMLNODE_NAME_OLD'][0] == '7') || ($Fields['XMLNODE_NAME_OLD'][0] == '8') || ($Fields['XMLNODE_NAME_OLD'][0] == '9') || ($Fields['XMLNODE_NAME_OLD'][0] == '10')) {
|
if (($Fields['XMLNODE_NAME_OLD'][0] == '1') || ($Fields['XMLNODE_NAME_OLD'][0] == '2') || ($Fields['XMLNODE_NAME_OLD'][0] == '3') || ($Fields['XMLNODE_NAME_OLD'][0] == '4') || ($Fields['XMLNODE_NAME_OLD'][0] == '5') || ($Fields['XMLNODE_NAME_OLD'][0] == '6') || ($Fields['XMLNODE_NAME_OLD'][0] == '7') || ($Fields['XMLNODE_NAME_OLD'][0] == '8') || ($Fields['XMLNODE_NAME_OLD'][0] == '9') || ($Fields['XMLNODE_NAME_OLD'][0] == '10')) {
|
||||||
$Fields['XMLNODE_NAME_OLD'] = '_' . $Fields['XMLNODE_NAME_OLD'];
|
$Fields['XMLNODE_NAME_OLD'] = '_' . $Fields['XMLNODE_NAME_OLD'];
|
||||||
}
|
}
|
||||||
$res = $this->_dbses->Execute( 'SELECT * FROM dynaForm WHERE XMLNODE_NAME="' . $Fields['XMLNODE_NAME_OLD'] . '"' );
|
$res = $this->_dbses->Execute('SELECT * FROM dynaForm WHERE XMLNODE_NAME="' . $Fields['XMLNODE_NAME_OLD'] . '"');
|
||||||
}
|
}
|
||||||
$this->is_new = ($res->count() == 0);
|
$this->is_new = ($res->count() == 0);
|
||||||
$this->Fields = $Fields;
|
$this->Fields = $Fields;
|
||||||
unset( $this->Fields['XMLNODE_NAME_OLD'] );
|
unset($this->Fields['XMLNODE_NAME_OLD']);
|
||||||
/*
|
|
||||||
* MPD-10 to create fields that do not appear many attributes, only the main ones?
|
|
||||||
* The show those who are not white
|
|
||||||
*/
|
|
||||||
if ($this->is_new) {
|
|
||||||
foreach ($this->Fields as $key => $value) {
|
|
||||||
if ($value == "")
|
|
||||||
unset( $this->Fields[$key] );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$this->Fields['XMLNODE_NAME'] = $Fields['XMLNODE_NAME_OLD'];
|
|
||||||
}
|
|
||||||
/*$res = $this->_dbses->Execute('INSERT INTO dynaForm'.
|
|
||||||
' (XMLNODE_TYPE,XMLNODE_VALUE)'.
|
|
||||||
' VALUES ("cdata", "'."\n".'")');*/
|
|
||||||
parent::Save();
|
|
||||||
if ($this->is_new) {
|
|
||||||
/*
|
|
||||||
* Create a new field.
|
|
||||||
*/
|
|
||||||
foreach ($labels as $lang => $value) {
|
|
||||||
/*$res = $this->_dbses->Execute('INSERT INTO dynaForm'.
|
|
||||||
' (XMLNODE_TYPE,XMLNODE_VALUE)'.
|
|
||||||
' VALUES ("cdata", "'."\n".'")');*/
|
|
||||||
$res = $this->_dbses->Execute( 'INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . ' (XMLNODE_NAME,XMLNODE_VALUE,XMLNODE_TYPE) ' . 'VALUES ("","' . "\n " . '","cdata")' );
|
|
||||||
$res = $this->_dbses->Execute( 'INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . ' (XMLNODE_NAME,XMLNODE_VALUE) ' . 'VALUES ("' . $lang . '","' . str_replace( '"', '""', $value )/*."\n "*/.'")' );
|
|
||||||
if (isset( $options[$lang] )) {
|
|
||||||
foreach ($options[$lang] as $option => $text) {
|
|
||||||
$res = $this->_dbses->Execute( 'INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . '.' . $lang . ' (XMLNODE_NAME,XMLNODE_VALUE,XMLNODE_TYPE) ' . 'VALUES ("","' . " " . '","cdata")' );
|
|
||||||
$res = $this->_dbses->Execute( 'INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . '.' . $lang . ' (XMLNODE_NAME,XMLNODE_VALUE,name) ' . 'VALUES ("option","' . str_replace( '"', '""', $text ) . '","' . str_replace( '"', '""', $option ) . '")' );
|
|
||||||
$res = $this->_dbses->Execute( 'INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . '.' . $lang . ' (XMLNODE_NAME,XMLNODE_VALUE,XMLNODE_TYPE) ' . 'VALUES ("","' . "\n " . '","cdata")' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$res = $this->_dbses->Execute( 'INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . ' (XMLNODE_NAME,XMLNODE_VALUE,XMLNODE_TYPE) ' . 'VALUES ("","' . "\n" . '","cdata")' );
|
|
||||||
}
|
|
||||||
$res = $this->_dbses->Execute( 'INSERT INTO dynaForm' . ' (XMLNODE_TYPE,XMLNODE_VALUE)' . ' VALUES ("cdata", "' . "\n" . '")' );
|
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
* Update an existing field.
|
|
||||||
*/
|
|
||||||
$this->_dbses->Execute( 'UPDATE dynaForm SET XMLNODE_NAME = "' . $Fields['XMLNODE_NAME'] . '" WHERE XMLNODE_NAME = "' . $Fields['XMLNODE_NAME_OLD'] . '"' );
|
|
||||||
foreach ($labels as $lang => $value) {
|
|
||||||
$res = $this->_dbses->Execute( 'SELECT * FROM dynaForm.' . $Fields['XMLNODE_NAME'] . ' WHERE XMLNODE_NAME ="' . $lang . '"' );
|
|
||||||
if ($res->count() > 0) {
|
|
||||||
$res = $this->_dbses->Execute( 'UPDATE dynaForm.' . $Fields['XMLNODE_NAME'] . ' SET XMLNODE_VALUE = ' . '"' . str_replace( '"', '""', $value ) . '" WHERE XMLNODE_NAME ="' . $lang . '"' );
|
|
||||||
} else {
|
|
||||||
$res = $this->_dbses->Execute( 'INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . ' (XMLNODE_NAME,XMLNODE_VALUE) ' . 'VALUES ("' . $lang . '","' . str_replace( '"', '""', $value ) . '")' );
|
|
||||||
}
|
|
||||||
if (isset( $options[$lang] )) {
|
|
||||||
$res = $this->_dbses->Execute( 'DELETE FROM dynaForm.' . $Fields['XMLNODE_NAME'] . '.' . $lang . ' WHERE 1' );
|
|
||||||
foreach ($options[$lang] as $option => $text) {
|
|
||||||
$res = $this->_dbses->Execute( 'INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . '.' . $lang . ' (XMLNODE_NAME,XMLNODE_VALUE,name) ' . 'VALUES ("option","' . str_replace( '"', '""', $text ) . '","' . str_replace( '"', '""', $option ) . '")' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveField ($Fields, $attributes = array(), $options = array())
|
|
||||||
{
|
|
||||||
$dynaform = new dynaFormHandler( $this->getFileName());
|
|
||||||
if ($Fields['TYPE'] === 'javascript') {
|
|
||||||
$Fields['XMLNODE_VALUE'] = $Fields['CODE'];
|
|
||||||
unset( $Fields['CODE'] );
|
|
||||||
$attributes = array ();
|
|
||||||
}
|
|
||||||
if ($Fields['XMLNODE_NAME_OLD'] == '') {
|
|
||||||
if (($Fields['XMLNODE_NAME'][0] == '1') || ($Fields['XMLNODE_NAME'][0] == '2') || ($Fields['XMLNODE_NAME'][0] == '3') || ($Fields['XMLNODE_NAME'][0] == '4') || ($Fields['XMLNODE_NAME'][0] == '5') || ($Fields['XMLNODE_NAME'][0] == '6') || ($Fields['XMLNODE_NAME'][0] == '7') || ($Fields['XMLNODE_NAME'][0] == '8') || ($Fields['XMLNODE_NAME'][0] == '9') || ($Fields['XMLNODE_NAME'][0] == '10')) {
|
|
||||||
$Fields['XMLNODE_NAME'] = '_' . $Fields['XMLNODE_NAME'];
|
|
||||||
}
|
|
||||||
$res = $this->_dbses->Execute( 'SELECT * FROM dynaForm WHERE XMLNODE_NAME="' . $Fields['XMLNODE_NAME'] . '"' );
|
|
||||||
} else {
|
|
||||||
if (($Fields['XMLNODE_NAME_OLD'][0] == '1') || ($Fields['XMLNODE_NAME_OLD'][0] == '2') || ($Fields['XMLNODE_NAME_OLD'][0] == '3') || ($Fields['XMLNODE_NAME_OLD'][0] == '4') || ($Fields['XMLNODE_NAME_OLD'][0] == '5') || ($Fields['XMLNODE_NAME_OLD'][0] == '6') || ($Fields['XMLNODE_NAME_OLD'][0] == '7') || ($Fields['XMLNODE_NAME_OLD'][0] == '8') || ($Fields['XMLNODE_NAME_OLD'][0] == '9') || ($Fields['XMLNODE_NAME_OLD'][0] == '10')) {
|
|
||||||
$Fields['XMLNODE_NAME_OLD'] = '_' . $Fields['XMLNODE_NAME_OLD'];
|
|
||||||
}
|
|
||||||
$res = $this->_dbses->Execute( 'SELECT * FROM dynaForm WHERE XMLNODE_NAME="' . $Fields['XMLNODE_NAME_OLD'] . '"' );
|
|
||||||
}
|
|
||||||
$this->is_new = ($res->count() == 0);
|
|
||||||
$this->Fields = $Fields;
|
|
||||||
unset( $this->Fields['XMLNODE_NAME_OLD'] );
|
|
||||||
/*
|
/*
|
||||||
* MPD-10 to create fields that do not appear many attributes, only the main ones?
|
* MPD-10 to create fields that do not appear many attributes, only the main ones?
|
||||||
* The show those who are not white
|
* The show those who are not white
|
||||||
@@ -205,7 +127,88 @@ class DynaFormField extends DBTable
|
|||||||
if ($this->is_new) {
|
if ($this->is_new) {
|
||||||
foreach ($this->Fields as $key => $value) {
|
foreach ($this->Fields as $key => $value) {
|
||||||
if ($value == "") {
|
if ($value == "") {
|
||||||
unset( $this->Fields[$key] );
|
unset($this->Fields[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->Fields['XMLNODE_NAME'] = $Fields['XMLNODE_NAME_OLD'];
|
||||||
|
}
|
||||||
|
/* $res = $this->_dbses->Execute('INSERT INTO dynaForm'.
|
||||||
|
' (XMLNODE_TYPE,XMLNODE_VALUE)'.
|
||||||
|
' VALUES ("cdata", "'."\n".'")'); */
|
||||||
|
parent::Save();
|
||||||
|
if ($this->is_new) {
|
||||||
|
/*
|
||||||
|
* Create a new field.
|
||||||
|
*/
|
||||||
|
foreach ($labels as $lang => $value) {
|
||||||
|
/* $res = $this->_dbses->Execute('INSERT INTO dynaForm'.
|
||||||
|
' (XMLNODE_TYPE,XMLNODE_VALUE)'.
|
||||||
|
' VALUES ("cdata", "'."\n".'")'); */
|
||||||
|
$res = $this->_dbses->Execute('INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . ' (XMLNODE_NAME,XMLNODE_VALUE,XMLNODE_TYPE) ' . 'VALUES ("","' . "\n " . '","cdata")');
|
||||||
|
$res = $this->_dbses->Execute('INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . ' (XMLNODE_NAME,XMLNODE_VALUE) ' . 'VALUES ("' . $lang . '","' . str_replace('"', '""', $value)/* ."\n " */ . '")');
|
||||||
|
if (isset($options[$lang])) {
|
||||||
|
foreach ($options[$lang] as $option => $text) {
|
||||||
|
$res = $this->_dbses->Execute('INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . '.' . $lang . ' (XMLNODE_NAME,XMLNODE_VALUE,XMLNODE_TYPE) ' . 'VALUES ("","' . " " . '","cdata")');
|
||||||
|
$res = $this->_dbses->Execute('INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . '.' . $lang . ' (XMLNODE_NAME,XMLNODE_VALUE,name) ' . 'VALUES ("option","' . str_replace('"', '""', $text) . '","' . str_replace('"', '""', $option) . '")');
|
||||||
|
$res = $this->_dbses->Execute('INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . '.' . $lang . ' (XMLNODE_NAME,XMLNODE_VALUE,XMLNODE_TYPE) ' . 'VALUES ("","' . "\n " . '","cdata")');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$res = $this->_dbses->Execute('INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . ' (XMLNODE_NAME,XMLNODE_VALUE,XMLNODE_TYPE) ' . 'VALUES ("","' . "\n" . '","cdata")');
|
||||||
|
}
|
||||||
|
$res = $this->_dbses->Execute('INSERT INTO dynaForm' . ' (XMLNODE_TYPE,XMLNODE_VALUE)' . ' VALUES ("cdata", "' . "\n" . '")');
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* Update an existing field.
|
||||||
|
*/
|
||||||
|
$this->_dbses->Execute('UPDATE dynaForm SET XMLNODE_NAME = "' . $Fields['XMLNODE_NAME'] . '" WHERE XMLNODE_NAME = "' . $Fields['XMLNODE_NAME_OLD'] . '"');
|
||||||
|
foreach ($labels as $lang => $value) {
|
||||||
|
$res = $this->_dbses->Execute('SELECT * FROM dynaForm.' . $Fields['XMLNODE_NAME'] . ' WHERE XMLNODE_NAME ="' . $lang . '"');
|
||||||
|
if ($res->count() > 0) {
|
||||||
|
$res = $this->_dbses->Execute('UPDATE dynaForm.' . $Fields['XMLNODE_NAME'] . ' SET XMLNODE_VALUE = ' . '"' . str_replace('"', '""', $value) . '" WHERE XMLNODE_NAME ="' . $lang . '"');
|
||||||
|
} else {
|
||||||
|
$res = $this->_dbses->Execute('INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . ' (XMLNODE_NAME,XMLNODE_VALUE) ' . 'VALUES ("' . $lang . '","' . str_replace('"', '""', $value) . '")');
|
||||||
|
}
|
||||||
|
if (isset($options[$lang])) {
|
||||||
|
$res = $this->_dbses->Execute('DELETE FROM dynaForm.' . $Fields['XMLNODE_NAME'] . '.' . $lang . ' WHERE 1');
|
||||||
|
foreach ($options[$lang] as $option => $text) {
|
||||||
|
$res = $this->_dbses->Execute('INSERT INTO dynaForm.' . $Fields['XMLNODE_NAME'] . '.' . $lang . ' (XMLNODE_NAME,XMLNODE_VALUE,name) ' . 'VALUES ("option","' . str_replace('"', '""', $text) . '","' . str_replace('"', '""', $option) . '")');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function saveField($Fields, $attributes = array(), $options = array())
|
||||||
|
{
|
||||||
|
$dynaform = new dynaFormHandler($this->getFileName());
|
||||||
|
if ($Fields['TYPE'] === 'javascript') {
|
||||||
|
$Fields['XMLNODE_VALUE'] = $Fields['CODE'];
|
||||||
|
unset($Fields['CODE']);
|
||||||
|
$attributes = array();
|
||||||
|
}
|
||||||
|
if ($Fields['XMLNODE_NAME_OLD'] == '') {
|
||||||
|
if (($Fields['XMLNODE_NAME'][0] == '1') || ($Fields['XMLNODE_NAME'][0] == '2') || ($Fields['XMLNODE_NAME'][0] == '3') || ($Fields['XMLNODE_NAME'][0] == '4') || ($Fields['XMLNODE_NAME'][0] == '5') || ($Fields['XMLNODE_NAME'][0] == '6') || ($Fields['XMLNODE_NAME'][0] == '7') || ($Fields['XMLNODE_NAME'][0] == '8') || ($Fields['XMLNODE_NAME'][0] == '9') || ($Fields['XMLNODE_NAME'][0] == '10')) {
|
||||||
|
$Fields['XMLNODE_NAME'] = '_' . $Fields['XMLNODE_NAME'];
|
||||||
|
}
|
||||||
|
$res = $this->_dbses->Execute('SELECT * FROM dynaForm WHERE XMLNODE_NAME="' . $Fields['XMLNODE_NAME'] . '"');
|
||||||
|
} else {
|
||||||
|
if (($Fields['XMLNODE_NAME_OLD'][0] == '1') || ($Fields['XMLNODE_NAME_OLD'][0] == '2') || ($Fields['XMLNODE_NAME_OLD'][0] == '3') || ($Fields['XMLNODE_NAME_OLD'][0] == '4') || ($Fields['XMLNODE_NAME_OLD'][0] == '5') || ($Fields['XMLNODE_NAME_OLD'][0] == '6') || ($Fields['XMLNODE_NAME_OLD'][0] == '7') || ($Fields['XMLNODE_NAME_OLD'][0] == '8') || ($Fields['XMLNODE_NAME_OLD'][0] == '9') || ($Fields['XMLNODE_NAME_OLD'][0] == '10')) {
|
||||||
|
$Fields['XMLNODE_NAME_OLD'] = '_' . $Fields['XMLNODE_NAME_OLD'];
|
||||||
|
}
|
||||||
|
$res = $this->_dbses->Execute('SELECT * FROM dynaForm WHERE XMLNODE_NAME="' . $Fields['XMLNODE_NAME_OLD'] . '"');
|
||||||
|
}
|
||||||
|
$this->is_new = ($res->count() == 0);
|
||||||
|
$this->Fields = $Fields;
|
||||||
|
unset($this->Fields['XMLNODE_NAME_OLD']);
|
||||||
|
/*
|
||||||
|
* MPD-10 to create fields that do not appear many attributes, only the main ones?
|
||||||
|
* The show those who are not white
|
||||||
|
*/
|
||||||
|
if ($this->is_new) {
|
||||||
|
foreach ($this->Fields as $key => $value) {
|
||||||
|
if ($value == "") {
|
||||||
|
unset($this->Fields[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -218,10 +221,10 @@ class DynaFormField extends DBTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
$aOptions = array();
|
$aOptions = array();
|
||||||
if(isset($Fields['OPTIONS']) && is_array($Fields['OPTIONS']) ) {
|
if (isset($Fields['OPTIONS']) && is_array($Fields['OPTIONS'])) {
|
||||||
foreach ($Fields['OPTIONS'] as $key => $value) {
|
foreach ($Fields['OPTIONS'] as $key => $value) {
|
||||||
$aOptions[] = Array( 'name' => 'option', 'value' => $value['LABEL'],
|
$aOptions[] = Array('name' => 'option', 'value' => $value['LABEL'],
|
||||||
'attributes' => array('name'=>$value['NAME']) );
|
'attributes' => array('name' => $value['NAME']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,11 +241,10 @@ class DynaFormField extends DBTable
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function isNew ()
|
public function isNew()
|
||||||
{
|
{
|
||||||
$res = $this->_dbses->Execute( 'SELECT * FROM dynaForm WHERE XMLNODE_NAME="' . $this->Fields['XMLNODE_NAME'] . '"' );
|
$res = $this->_dbses->Execute('SELECT * FROM dynaForm WHERE XMLNODE_NAME="' . $this->Fields['XMLNODE_NAME'] . '"');
|
||||||
return ($res->count() == 0);
|
return ($res->count() == 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
//print_r( $_POST); die;
|
//print_r( $_POST); die;
|
||||||
/**
|
/**
|
||||||
* fields_Save.php
|
* fields_Save.php
|
||||||
@@ -25,227 +26,239 @@
|
|||||||
*/
|
*/
|
||||||
G::LoadClass('dynaformEditor');
|
G::LoadClass('dynaformEditor');
|
||||||
|
|
||||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
|
if (($RBAC_Response = $RBAC->userCanAccess("PM_FACTORY")) != 1) {
|
||||||
|
return $RBAC_Response;
|
||||||
|
}
|
||||||
|
|
||||||
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
||||||
|
|
||||||
G::LoadClass('dynaFormField');
|
G::LoadClass('dynaFormField');
|
||||||
|
|
||||||
$type=strtolower($_POST['form']['PME_TYPE']);
|
$type = strtolower($_POST['form']['PME_TYPE']);
|
||||||
if (!(isset($_POST['form']['PME_A']) && $_POST['form']['PME_A']!=='')) return;
|
if (!(isset($_POST['form']['PME_A']) && $_POST['form']['PME_A'] !== '')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_POST['form']['PME_REQUIRED'])) {
|
if (isset($_POST['form']['PME_REQUIRED'])) {
|
||||||
if ($_POST['form']['PME_REQUIRED'] == '') {
|
if ($_POST['form']['PME_REQUIRED'] == '') {
|
||||||
$_POST['form']['PME_REQUIRED'] = 0;
|
$_POST['form']['PME_REQUIRED'] = 0;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$_POST['form']['PME_REQUIRED'] = 0;
|
$_POST['form']['PME_REQUIRED'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['form']['PME_READONLY'])) {
|
if (isset($_POST['form']['PME_READONLY'])) {
|
||||||
if ($_POST['form']['PME_READONLY'] == '') {
|
if ($_POST['form']['PME_READONLY'] == '') {
|
||||||
$_POST['form']['PME_READONLY'] = 0;
|
$_POST['form']['PME_READONLY'] = 0;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$_POST['form']['PME_READONLY'] = 0;
|
$_POST['form']['PME_READONLY'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['form']['PME_SAVELABEL'])) {
|
if (isset($_POST['form']['PME_SAVELABEL'])) {
|
||||||
if ($_POST['form']['PME_SAVELABEL'] == '') {
|
if ($_POST['form']['PME_SAVELABEL'] == '') {
|
||||||
$_POST['form']['PME_SAVELABEL'] = 0;
|
$_POST['form']['PME_SAVELABEL'] = 0;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$_POST['form']['PME_SAVELABEL'] = 0;
|
$_POST['form']['PME_SAVELABEL'] = 0;
|
||||||
}
|
}
|
||||||
$A = $_POST['form']['PME_A'];
|
$A = $_POST['form']['PME_A'];
|
||||||
if (isset($_POST['form']['PME_SAVELABEL'])
|
if (isset($_POST['form']['PME_SAVELABEL'])
|
||||||
&& isset($_POST['form']['PME_CODE'])
|
&& isset($_POST['form']['PME_CODE'])
|
||||||
&& $_POST['form']['PME_TYPE'] === 'javascript'){
|
&& $_POST['form']['PME_TYPE'] === 'javascript') {
|
||||||
$sType = $_POST['form']['PME_TYPE'];
|
$sType = $_POST['form']['PME_TYPE'];
|
||||||
// $A = $_POST['form']['PME_A'];
|
// $A = $_POST['form']['PME_A'];
|
||||||
$fieldName = $_POST['form']['PME_XMLNODE_NAME'];
|
$fieldName = $_POST['form']['PME_XMLNODE_NAME'];
|
||||||
$pmeCode = $_POST['form']['PME_CODE'];
|
$pmeCode = $_POST['form']['PME_CODE'];
|
||||||
$_POST['form']['PME_CODE'] = '';
|
$_POST['form']['PME_CODE'] = '';
|
||||||
// $pmeCode = str_replace("'", "''", $pmeCode);
|
// $pmeCode = str_replace("'", "''", $pmeCode);
|
||||||
// $pmeCode = str_replace('"', '""', $pmeCode);
|
// $pmeCode = str_replace('"', '""', $pmeCode);
|
||||||
// $pmeCode = preg_replace("/\)\s*\n/", ") //\n", $pmeCode);
|
// $pmeCode = preg_replace("/\)\s*\n/", ") //\n", $pmeCode);
|
||||||
// $_POST['form']['PME_CODE'] = $pmeCode;
|
// $_POST['form']['PME_CODE'] = $pmeCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
$file = G::decrypt( $_POST['form']['PME_A'] , URL_KEY );
|
$file = G::decrypt($_POST['form']['PME_A'], URL_KEY);
|
||||||
define('DB_XMLDB_HOST', PATH_DYNAFORM . $file . '.xml' );
|
define('DB_XMLDB_HOST', PATH_DYNAFORM . $file . '.xml');
|
||||||
define('DB_XMLDB_USER','');
|
define('DB_XMLDB_USER', '');
|
||||||
define('DB_XMLDB_PASS','');
|
define('DB_XMLDB_PASS', '');
|
||||||
define('DB_XMLDB_NAME','');
|
define('DB_XMLDB_NAME', '');
|
||||||
define('DB_XMLDB_TYPE','myxml');
|
define('DB_XMLDB_TYPE', 'myxml');
|
||||||
|
|
||||||
// if (isset($_POST['form']['PME_XMLNODE_VALUE'])){
|
// if (isset($_POST['form']['PME_XMLNODE_VALUE'])){
|
||||||
// $_POST['form']['PME_XMLNODE_VALUE'] = str_replace("'", "''" , $_POST['form']['PME_XMLNODE_VALUE']);
|
// $_POST['form']['PME_XMLNODE_VALUE'] = str_replace("'", "''" , $_POST['form']['PME_XMLNODE_VALUE']);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (file_exists( PATH_XMLFORM . 'dynaforms/fields/' . $type . '.xml')) {
|
if (file_exists(PATH_XMLFORM . 'dynaforms/fields/' . $type . '.xml')) {
|
||||||
$form=new Form('dynaforms/fields/' . $type , PATH_XMLFORM);
|
$form = new Form('dynaforms/fields/' . $type, PATH_XMLFORM);
|
||||||
//TODO: Verify why validatePost removes PME_XMLGRID.
|
//TODO: Verify why validatePost removes PME_XMLGRID.
|
||||||
$isGrid=isset($_POST['form']['PME_XMLGRID']);
|
$isGrid = isset($_POST['form']['PME_XMLGRID']);
|
||||||
if ($isGrid) $xmlGrid=$_POST['form']['PME_XMLGRID'];
|
if ($isGrid) {
|
||||||
|
$xmlGrid = $_POST['form']['PME_XMLGRID'];
|
||||||
|
}
|
||||||
//$form->validatePost();
|
//$form->validatePost();
|
||||||
if ($isGrid) $_POST['form']['PME_XMLGRID']=$xmlGrid;
|
if ($isGrid) {
|
||||||
if ($type==='checkbox') {
|
$_POST['form']['PME_XMLGRID'] = $xmlGrid;
|
||||||
|
}
|
||||||
|
if ($type === 'checkbox') {
|
||||||
// added by Gustavo Cruz
|
// added by Gustavo Cruz
|
||||||
if ($_POST['form']['PME_DEFAULTVALUE']==="1") {
|
if ($_POST['form']['PME_DEFAULTVALUE'] === "1") {
|
||||||
$_POST['form']['PME_DEFAULTVALUE']=$_POST['form']['PME_VALUE'];
|
$_POST['form']['PME_DEFAULTVALUE'] = $_POST['form']['PME_VALUE'];
|
||||||
} else {
|
} else {
|
||||||
$_POST['form']['PME_DEFAULTVALUE']=$_POST['form']['PME_FALSEVALUE'];
|
$_POST['form']['PME_DEFAULTVALUE'] = $_POST['form']['PME_FALSEVALUE'];
|
||||||
}
|
}
|
||||||
// end added code
|
// end added code
|
||||||
// verify why $form->fields['PME_DEFAULTVALUE']->value doesn't capture the value 1
|
// verify why $form->fields['PME_DEFAULTVALUE']->value doesn't capture the value 1
|
||||||
// if ($_POST['form']['PME_DEFAULTVALUE']===$form->fields['PME_DEFAULTVALUE']->value) {
|
// if ($_POST['form']['PME_DEFAULTVALUE']===$form->fields['PME_DEFAULTVALUE']->value) {
|
||||||
// $_POST['form']['PME_DEFAULTVALUE']=$_POST['form']['PME_VALUE'];
|
// $_POST['form']['PME_DEFAULTVALUE']=$_POST['form']['PME_VALUE'];
|
||||||
// } else {
|
// } else {
|
||||||
// $_POST['form']['PME_DEFAULTVALUE']=$_POST['form']['PME_FALSEVALUE'];
|
// $_POST['form']['PME_DEFAULTVALUE']=$_POST['form']['PME_FALSEVALUE'];
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
if ($type==='grid') {
|
if ($type === 'grid') {
|
||||||
if (!isset($_POST['form']['PME_ADDROW'])) {
|
if (!isset($_POST['form']['PME_ADDROW'])) {
|
||||||
$_POST['form']['PME_ADDROW'] = '0';
|
$_POST['form']['PME_ADDROW'] = '0';
|
||||||
}
|
}
|
||||||
if (!isset($_POST['form']['PME_DELETEROW'])) {
|
if (!isset($_POST['form']['PME_DELETEROW'])) {
|
||||||
$_POST['form']['PME_DELETEROW'] = '0';
|
$_POST['form']['PME_DELETEROW'] = '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($type==='dropdown' || $type==='listbox' ) {
|
if ($type === 'dropdown' || $type === 'listbox') {
|
||||||
if(isset($_POST['form']['PME_OPTIONS'][1])){
|
if (isset($_POST['form']['PME_OPTIONS'][1])) {
|
||||||
if($_POST['form']['PME_OPTIONS']['1']['NAME'] === "" &&
|
if ($_POST['form']['PME_OPTIONS']['1']['NAME'] === "" &&
|
||||||
$_POST['form']['PME_OPTIONS']['1']['LABEL'] === ""){
|
$_POST['form']['PME_OPTIONS']['1']['LABEL'] === "") {
|
||||||
unset($_POST['form']['PME_OPTIONS']);
|
unset($_POST['form']['PME_OPTIONS']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
foreach ($_POST['form'] as $key => $value) {
|
||||||
|
if (substr($key, 0, 4) === 'PME_') {
|
||||||
|
$res[substr($key, 4)] = $value;
|
||||||
|
} else {
|
||||||
|
$res[$key] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$_POST['form'] = $res;
|
||||||
|
|
||||||
}
|
$dbc = new DBConnection(PATH_DYNAFORM . $file . '.xml', '', '', '', 'myxml');
|
||||||
foreach($_POST['form'] as $key => $value){
|
$ses = new DBSession($dbc);
|
||||||
if (substr($key,0,4)==='PME_')
|
|
||||||
$res[substr($key,4)]=$value;
|
|
||||||
else
|
|
||||||
$res[$key]=$value;
|
|
||||||
}
|
|
||||||
$_POST['form']=$res;
|
|
||||||
|
|
||||||
$dbc = new DBConnection( PATH_DYNAFORM . $file . '.xml' ,'','','','myxml' );
|
$fields = new DynaFormField($dbc);
|
||||||
$ses = new DBSession($dbc);
|
|
||||||
|
|
||||||
$fields = new DynaFormField( $dbc );
|
if ($_POST['form']['XMLNODE_NAME'] === '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($_POST['form']['XMLNODE_NAME']==='') return;
|
$attributes = $_POST['form'];
|
||||||
|
|
||||||
$attributes = $_POST['form'];
|
if (isset($attributes['HINT'])) {
|
||||||
|
|
||||||
if (isset($attributes['HINT'])) {
|
|
||||||
$attributes['HINT'] = addslashes($attributes['HINT']);
|
$attributes['HINT'] = addslashes($attributes['HINT']);
|
||||||
$attributes['HINT'] = htmlspecialchars($attributes['HINT'], ENT_QUOTES, "UTF-8");
|
$attributes['HINT'] = htmlspecialchars($attributes['HINT'], ENT_QUOTES, "UTF-8");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($attributes['CODE'])) $attributes['XMLNODE_VALUE'] = ($attributes['CODE']);
|
if (isset($attributes['CODE'])) {
|
||||||
|
$attributes['XMLNODE_VALUE'] = ($attributes['CODE']);
|
||||||
|
}
|
||||||
|
|
||||||
$labels = array();
|
$labels = array();
|
||||||
if (isset($attributes['LABEL'])) $labels = array ( SYS_LANG => $attributes['LABEL'] );
|
if (isset($attributes['LABEL'])) {
|
||||||
|
$labels = array(SYS_LANG => $attributes['LABEL']);
|
||||||
|
}
|
||||||
|
|
||||||
unset($attributes['A']);
|
unset($attributes['A']);
|
||||||
unset($attributes['ACCEPT']);
|
unset($attributes['ACCEPT']);
|
||||||
unset($attributes['LABEL']);
|
unset($attributes['LABEL']);
|
||||||
unset($attributes['PRO_UID']);
|
unset($attributes['PRO_UID']);
|
||||||
|
|
||||||
$options = NULL;
|
$options = null;
|
||||||
foreach($attributes as $key => $value ) {
|
foreach ($attributes as $key => $value) {
|
||||||
if ($key==='OPTIONS') {
|
if ($key === 'OPTIONS') {
|
||||||
if (is_array($value)){
|
if (is_array($value)) {
|
||||||
if (is_array(reset($value))) {
|
if (is_array(reset($value))) {
|
||||||
$langs = array();
|
$langs = array();
|
||||||
$options = array();
|
$options = array();
|
||||||
$langs[] = SYS_LANG;
|
$langs[] = SYS_LANG;
|
||||||
$options[SYS_LANG]=array();
|
$options[SYS_LANG] = array();
|
||||||
foreach( $value as $row ) {
|
foreach ($value as $row) {
|
||||||
foreach( $langs as $lang ) {
|
foreach ($langs as $lang) {
|
||||||
$LANG = strtoupper($lang);
|
$LANG = strtoupper($lang);
|
||||||
if (isset($row['LABEL']))
|
if (isset($row['LABEL'])) {
|
||||||
$options[$lang][$row['NAME']]=$row['LABEL'];
|
$options[$lang][$row['NAME']] = $row['LABEL'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* $first = reset($value);
|
||||||
|
foreach( $first as $optKey => $optValue ) {
|
||||||
|
if (substr($optKey,0,6)==='LABEL_') {
|
||||||
|
$langs[]=strtolower(substr($optKey,6));
|
||||||
|
$options[strtolower(substr($optKey,6))]=array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach( $value as $row ) {
|
||||||
|
foreach( $langs as $lang ) {
|
||||||
|
$LANG = strtoupper($lang);
|
||||||
|
if (isset($row['LABEL_'.$LANG]))
|
||||||
|
$options[$lang][$row['NAME']]=$row['LABEL_'.$LANG];
|
||||||
|
}
|
||||||
|
} */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/*$first = reset($value);
|
|
||||||
foreach( $first as $optKey => $optValue ) {
|
|
||||||
if (substr($optKey,0,6)==='LABEL_') {
|
|
||||||
$langs[]=strtolower(substr($optKey,6));
|
|
||||||
$options[strtolower(substr($optKey,6))]=array();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach( $value as $row ) {
|
|
||||||
foreach( $langs as $lang ) {
|
|
||||||
$LANG = strtoupper($lang);
|
|
||||||
if (isset($row['LABEL_'.$LANG]))
|
|
||||||
$options[$lang][$row['NAME']]=$row['LABEL_'.$LANG];
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (is_array($value)){
|
if (is_array($value)) {
|
||||||
//Is a list:
|
//Is a list:
|
||||||
if (is_string(reset($value))) {
|
if (is_string(reset($value))) {
|
||||||
$attributes[$key] = implode(',',$value);
|
$attributes[$key] = implode(',', $value);
|
||||||
} else {
|
} else {
|
||||||
//Is a grid.
|
//Is a grid.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($attributes['VALIDATE_NAME']);
|
unset($attributes['VALIDATE_NAME']);
|
||||||
$fields->setFileName(PATH_DYNAFORM . $file . '.xml' );
|
$fields->setFileName(PATH_DYNAFORM . $file . '.xml');
|
||||||
|
|
||||||
$FieldAttributes = $attributes;
|
$FieldAttributes = $attributes;
|
||||||
$FieldAttrib = array();
|
$FieldAttrib = array();
|
||||||
unset($FieldAttributes['XMLNODE_NAME']);
|
unset($FieldAttributes['XMLNODE_NAME']);
|
||||||
unset($FieldAttributes['XMLNODE_NAME_OLD']);
|
unset($FieldAttributes['XMLNODE_NAME_OLD']);
|
||||||
unset($FieldAttributes['XMLNODE_VALUE']);
|
unset($FieldAttributes['XMLNODE_VALUE']);
|
||||||
unset($FieldAttributes['BTN_CANCEL']);
|
unset($FieldAttributes['BTN_CANCEL']);
|
||||||
unset($FieldAttributes['SAVELABEL']);
|
unset($FieldAttributes['SAVELABEL']);
|
||||||
foreach ($FieldAttributes as $key => $value) {
|
foreach ($FieldAttributes as $key => $value) {
|
||||||
if ($value != "") {
|
if ($value != "") {
|
||||||
$FieldAttrib[strtolower($key)] = $value;
|
$FieldAttrib[strtolower($key)] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields->saveField($attributes, $FieldAttrib, $labels );
|
$fields->saveField($attributes, $FieldAttrib, $labels);
|
||||||
|
|
||||||
G::LoadClass('xmlDb');
|
G::LoadClass('xmlDb');
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$aFields = array();
|
$aFields = array();
|
||||||
$aFields[] = array('XMLNODE_NAME' => 'char',
|
$aFields[] = array('XMLNODE_NAME' => 'char',
|
||||||
'TYPE' => 'char',
|
'TYPE' => 'char',
|
||||||
'UP' => 'char',
|
'UP' => 'char',
|
||||||
'DOWN' => 'char',
|
'DOWN' => 'char',
|
||||||
'row__' => 'integer');
|
'row__' => 'integer');
|
||||||
$oSession = new DBSession(new DBConnection(PATH_DYNAFORM . $file . '.xml', '', '', '', 'myxml'));
|
$oSession = new DBSession(new DBConnection(PATH_DYNAFORM . $file . '.xml', '', '', '', 'myxml'));
|
||||||
$oDataset = $oSession->Execute('SELECT * FROM dynaForm WHERE NOT( XMLNODE_NAME = "" )');
|
$oDataset = $oSession->Execute('SELECT * FROM dynaForm WHERE NOT( XMLNODE_NAME = "" )');
|
||||||
$iMaximun = $oDataset->count();
|
$iMaximun = $oDataset->count();
|
||||||
while ($aRow = $oDataset->Read()) {
|
while ($aRow = $oDataset->Read()) {
|
||||||
$aFields[] = array('XMLNODE_NAME' => $aRow['XMLNODE_NAME'],
|
$aFields[] = array('XMLNODE_NAME' => $aRow['XMLNODE_NAME'],
|
||||||
'TYPE' => $aRow['TYPE'],
|
'TYPE' => $aRow['TYPE'],
|
||||||
'UP' => ($i > 0 ? G::LoadTranslation('ID_UP') : ''),
|
'UP' => ($i > 0 ? G::LoadTranslation('ID_UP') : ''),
|
||||||
'DOWN' => ($i < $iMaximun-1 ? G::LoadTranslation('ID_DOWN') : ''),
|
'DOWN' => ($i < $iMaximun - 1 ? G::LoadTranslation('ID_DOWN') : ''),
|
||||||
'row__' => ($i + 1));
|
'row__' => ($i + 1));
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
global $_DBArray;
|
global $_DBArray;
|
||||||
$_DBArray['fields'] = $aFields;
|
$_DBArray['fields'] = $aFields;
|
||||||
$_SESSION['_DBArray'] = $_DBArray;
|
$_SESSION['_DBArray'] = $_DBArray;
|
||||||
|
|
||||||
// Additions to javascript
|
// Additions to javascript
|
||||||
if(isset($sType) && $sType === 'javascript'){
|
if (isset($sType) && $sType === 'javascript') {
|
||||||
$sCode = urlencode($pmeCode);
|
$sCode = urlencode($pmeCode);
|
||||||
$editor = new dynaformEditorAjax($_POST);
|
$editor = new dynaformEditorAjax($_POST);
|
||||||
$editor->set_javascript($A, $fieldName, $sCode);
|
$editor->set_javascript($A, $fieldName, $sCode);
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
Reference in New Issue
Block a user