CODE STYLE class.xmlfield_Image.php and class.xmlfield_InputPM.php
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.xmlfield_Image.php
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
@@ -27,22 +29,26 @@
|
||||
// in future releases of pm, its discouraged the inclusion this class in the future from a
|
||||
// external file like this
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
class XmlForm_Field_Image extends XmlForm_Field
|
||||
{
|
||||
var $file = '';
|
||||
var $home = 'public_html';
|
||||
var $withoutLabel = false;
|
||||
function render( $value, $owner = null )
|
||||
public $file = '';
|
||||
public $home = 'public_html';
|
||||
public $withoutLabel = false;
|
||||
|
||||
public function render ($value, $owner = null)
|
||||
{
|
||||
$url = G::replaceDataField( $this->file, $owner->values );
|
||||
if ($this->home === "methods") $url = G::encryptlink( SYS_URI . $url );
|
||||
if ($this->home === "public_html") $url ='/' . $url ;
|
||||
return '<img src="'.htmlentities( $url, ENT_QUOTES, 'utf-8').'" '.
|
||||
(($this->style)?'style="'.$this->style.'"':'')
|
||||
.' alt ="'.htmlentities($value,ENT_QUOTES,'utf-8').'"/>';
|
||||
if ($this->home === "methods") {
|
||||
$url = G::encryptlink( SYS_URI . $url );
|
||||
}
|
||||
if ($this->home === "public_html") {
|
||||
$url = '/' . $url;
|
||||
}
|
||||
return '<img src="' . htmlentities( $url, ENT_QUOTES, 'utf-8' ) . '" ' . (($this->style) ? 'style="' . $this->style . '"' : '') . ' alt ="' . htmlentities( $value, ENT_QUOTES, 'utf-8' ) . '"/>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.xmlfield_InputPM.php
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
@@ -27,37 +29,38 @@
|
||||
|
||||
class XmlForm_Field_TextPM extends XmlForm_Field_SimpleText
|
||||
{
|
||||
var $size=15;
|
||||
var $maxLength=64;
|
||||
var $validate='Any';
|
||||
var $mask = '';
|
||||
var $defaultValue='';
|
||||
var $required=false;
|
||||
var $dependentFields='';
|
||||
var $linkField='';
|
||||
public $size = 15;
|
||||
public $maxLength = 64;
|
||||
public $validate = 'Any';
|
||||
public $mask = '';
|
||||
public $defaultValue = '';
|
||||
public $required = false;
|
||||
public $dependentFields = '';
|
||||
public $linkField = '';
|
||||
//Possible values:(-|UPPER|LOWER|CAPITALIZE)
|
||||
var $strTo='';
|
||||
var $readOnly=false;
|
||||
var $sqlConnection=0;
|
||||
var $sql='';
|
||||
var $sqlOption=array();
|
||||
public $strTo = '';
|
||||
public $readOnly = false;
|
||||
public $sqlConnection = 0;
|
||||
public $sql = '';
|
||||
public $sqlOption = array ();
|
||||
//Atributes only for grids
|
||||
var $formula = '';
|
||||
var $function = '';
|
||||
var $replaceTags = 0;
|
||||
var $showVars = 0;
|
||||
var $process = '';
|
||||
var $symbol = '@@';
|
||||
public $formula = '';
|
||||
public $function = '';
|
||||
public $replaceTags = 0;
|
||||
public $showVars = 0;
|
||||
public $process = '';
|
||||
public $symbol = '@@';
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
function render( $value = NULL , $owner = NULL )
|
||||
public function render ($value = null, $owner = null)
|
||||
{
|
||||
//$this->executeSQL();
|
||||
//if (isset($this->sqlOption)) {
|
||||
@@ -66,10 +69,12 @@ class XmlForm_Field_TextPM extends XmlForm_Field_SimpleText
|
||||
// if (isset($firstElement)) $value = $firstElement;
|
||||
//}
|
||||
//NOTE: string functions must be in G class
|
||||
if ($this->strTo==='UPPER')
|
||||
if ($this->strTo === 'UPPER') {
|
||||
$value = strtoupper( $value );
|
||||
if ($this->strTo==='LOWER')
|
||||
}
|
||||
if ($this->strTo === 'LOWER') {
|
||||
$value = strtolower( $value );
|
||||
}
|
||||
//if ($this->strTo==='CAPITALIZE') $value = strtocapitalize($value);
|
||||
$onkeypress = G::replaceDataField( $this->onkeypress, $owner->values );
|
||||
if ($this->replaceTags == 1) {
|
||||
@@ -79,18 +84,17 @@ class XmlForm_Field_TextPM extends XmlForm_Field_SimpleText
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly)
|
||||
if ($this->readOnly) {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
else
|
||||
} else {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
return '<input class="module_app_input___gray" id="form['.$this->name.']" name="form['.$this->name.']" type ="text" size="'.$this->size.'" maxlength="'.$this->maxLength.'" value=\''.$this->htmlentities( $value , ENT_COMPAT, 'utf-8').'\' style="display:none;'.htmlentities( $this->style , ENT_COMPAT, 'utf-8').'" onkeypress="'.htmlentities( $onkeypress , ENT_COMPAT, 'utf-8').'"/>' .
|
||||
$this->htmlentities( $value , ENT_COMPAT, 'utf-8');
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
} else {
|
||||
return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
@@ -98,13 +102,14 @@ class XmlForm_Field_TextPM extends XmlForm_Field_SimpleText
|
||||
|
||||
/**
|
||||
* Function renderGrid
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter array values
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
function renderGrid( $values=array() , $owner )
|
||||
public function renderGrid ($values = array(), $owner)
|
||||
{
|
||||
$result = array ();
|
||||
$r = 1;
|
||||
@@ -116,15 +121,15 @@ class XmlForm_Field_TextPM extends XmlForm_Field_SimpleText
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$owner->name .']['.$r.']['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $owner->name . '][' . $r . '][' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly)
|
||||
if ($this->readOnly) {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
else
|
||||
} else {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
} else {
|
||||
@@ -137,11 +142,12 @@ class XmlForm_Field_TextPM extends XmlForm_Field_SimpleText
|
||||
|
||||
/**
|
||||
* Function attachEvents
|
||||
*
|
||||
* @access public
|
||||
* @param eter string $element
|
||||
* @return string
|
||||
*/
|
||||
function attachEvents($element)
|
||||
public function attachEvents ($element)
|
||||
{
|
||||
return "myForm.aElements[i] = new G_Text(myForm, $element,'{$this->name}');
|
||||
myForm.aElements[i].setAttributes(" . $this->getAttributes() . ");";
|
||||
@@ -153,37 +159,38 @@ class XmlForm_Field_TextPM extends XmlForm_Field_SimpleText
|
||||
*/
|
||||
class XmlForm_Field_TextareaPM extends XmlForm_Field
|
||||
{
|
||||
var $rows = 12;
|
||||
var $cols = 40;
|
||||
var $required = false;
|
||||
var $readOnly = false;
|
||||
var $wrap = 'OFF';
|
||||
var $showVars = 0;
|
||||
var $process = '';
|
||||
var $symbol = '@@';
|
||||
public $rows = 12;
|
||||
public $cols = 40;
|
||||
public $required = false;
|
||||
public $readOnly = false;
|
||||
public $wrap = 'OFF';
|
||||
public $showVars = 0;
|
||||
public $process = '';
|
||||
public $symbol = '@@';
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author Julio Cesar Laura Avendao <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
function render( $value = NULL, $owner )
|
||||
public function render ($value = null, $owner)
|
||||
{
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly)
|
||||
if ($this->readOnly) {
|
||||
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" style="' . $this->style . '" wrap="' . htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" class="FormTextPM" readOnly>' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '</textarea>' . $sShowVars;
|
||||
else
|
||||
} else {
|
||||
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" style="' . $this->style . '" wrap="' . htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" class="FormTextPM" >' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '</textarea>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" readOnly style="border:0px;backgroud-color:inherit;' . $this->style . '" wrap="' . htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" class="FormTextPM" >' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '</textarea>';
|
||||
} else {
|
||||
@@ -193,13 +200,14 @@ class XmlForm_Field_TextareaPM extends XmlForm_Field
|
||||
|
||||
/**
|
||||
* Function renderGrid
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string values
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
function renderGrid( $values = NULL , $owner )
|
||||
public function renderGrid ($values = null, $owner)
|
||||
{
|
||||
$result = array ();
|
||||
$r = 1;
|
||||
@@ -208,21 +216,20 @@ class XmlForm_Field_TextareaPM extends XmlForm_Field
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$owner->name .']['.$r.']['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $owner->name . '][' . $r . '][' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly)
|
||||
if ($this->readOnly) {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly"/>' . $sShowVars;
|
||||
else
|
||||
} else {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '\' />' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
if (stristr( $_SERVER['HTTP_USER_AGENT'], 'iPhone' )) {
|
||||
//$result[] = '<div style="overflow:hidden;height:25px;padding:0px;margin:0px;">'.$this->htmlentities( $v , ENT_COMPAT, 'utf-8').'</div>';
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
//$result[] = '<div style="overflow:hidden;width:inherit;height:2em;padding:0px;margin:0px;">'.$this->htmlentities( $v , ENT_COMPAT, 'utf-8').'</div>';
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
@@ -240,42 +247,45 @@ class XmlForm_Field_TextareaPM extends XmlForm_Field
|
||||
*/
|
||||
class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
{
|
||||
var $size = 15;
|
||||
var $maxLength = 64;
|
||||
var $validate = 'Any';
|
||||
var $mask = '';
|
||||
var $defaultValue = '';
|
||||
var $required = false;
|
||||
var $dependentFields= '';
|
||||
var $linkField = '';
|
||||
public $size = 15;
|
||||
public $maxLength = 64;
|
||||
public $validate = 'Any';
|
||||
public $mask = '';
|
||||
public $defaultValue = '';
|
||||
public $required = false;
|
||||
public $dependentFields = '';
|
||||
public $linkField = '';
|
||||
//Possible values:(-|UPPER|LOWER|CAPITALIZE)
|
||||
var $strTo = '';
|
||||
var $readOnly = false;
|
||||
var $sqlConnection = 0;
|
||||
var $sql = '';
|
||||
var $sqlOption = array();
|
||||
public $strTo = '';
|
||||
public $readOnly = false;
|
||||
public $sqlConnection = 0;
|
||||
public $sql = '';
|
||||
public $sqlOption = array ();
|
||||
//Atributes only for grids
|
||||
var $formula = '';
|
||||
var $function = '';
|
||||
var $replaceTags = 0;
|
||||
var $showVars = 0;
|
||||
var $process = '';
|
||||
var $symbol = '@@';
|
||||
public $formula = '';
|
||||
public $function = '';
|
||||
public $replaceTags = 0;
|
||||
public $showVars = 0;
|
||||
public $process = '';
|
||||
public $symbol = '@@';
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
function render( $value = NULL , $owner = NULL )
|
||||
public function render ($value = null, $owner = null)
|
||||
{
|
||||
if ($this->strTo==='UPPER')
|
||||
if ($this->strTo === 'UPPER') {
|
||||
$value = strtoupper( $value );
|
||||
if ($this->strTo==='LOWER')
|
||||
}
|
||||
if ($this->strTo === 'LOWER') {
|
||||
$value = strtolower( $value );
|
||||
}
|
||||
//if ($this->strTo==='CAPITALIZE') $value = strtocapitalize($value);
|
||||
$onkeypress = G::replaceDataField( $this->onkeypress, $owner->values );
|
||||
if ($this->replaceTags == 1) {
|
||||
@@ -285,18 +295,17 @@ class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly)
|
||||
if ($this->readOnly) {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
else
|
||||
} else {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
return '<input class="module_app_input___gray" id="form['.$this->name.']" name="form['.$this->name.']" type ="text" size="'.$this->size.'" maxlength="'.$this->maxLength.'" value=\''.$this->htmlentities( $value , ENT_COMPAT, 'utf-8').'\' style="display:none;'.htmlentities( $this->style , ENT_COMPAT, 'utf-8').'" onkeypress="'.htmlentities( $onkeypress , ENT_COMPAT, 'utf-8').'"/>' .
|
||||
$this->htmlentities( $value , ENT_COMPAT, 'utf-8');
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
} else {
|
||||
return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
@@ -304,13 +313,14 @@ class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
|
||||
/**
|
||||
* Function renderGrid
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter array values
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
function renderGrid( $values=array() , $owner )
|
||||
public function renderGrid ($values = array(), $owner)
|
||||
{
|
||||
$result = array ();
|
||||
$r = 1;
|
||||
@@ -322,15 +332,15 @@ class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$owner->name .']['.$r.']['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $owner->name . '][' . $r . '][' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly)
|
||||
if ($this->readOnly) {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
else
|
||||
} else {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
$result[] = '<p align="' . $this->align . '">' . $this->htmlentities( number_format( $v, 2 ), ENT_COMPAT, 'utf-8' ) . '</p>';
|
||||
} else {
|
||||
@@ -343,11 +353,12 @@ class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
|
||||
/**
|
||||
* Function attachEvents
|
||||
*
|
||||
* @access public
|
||||
* @param eter string $element
|
||||
* @return string
|
||||
*/
|
||||
function attachEvents($element)
|
||||
public function attachEvents ($element)
|
||||
{
|
||||
return "myForm.aElements[i] = new G_Text(myForm, $element,'{$this->name}');
|
||||
myForm.aElements[i].setAttributes(" . $this->getAttributes() . ");";
|
||||
@@ -356,25 +367,30 @@ class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
|
||||
/**
|
||||
* Function getDynaformsVars
|
||||
*
|
||||
* @access public
|
||||
* @param eter string $sProcessUID
|
||||
* @param eter boolean $bSystemVars
|
||||
* @return array
|
||||
*/
|
||||
function getDynaformsVars($sProcessUID, $bSystemVars = true, $bIncMulSelFields = 0)
|
||||
public function getDynaformsVars ($sProcessUID, $bSystemVars = true, $bIncMulSelFields = 0)
|
||||
{
|
||||
$aFields = array ();
|
||||
$aFieldsNames = array ();
|
||||
if ($bSystemVars) {
|
||||
$aAux = G::getSystemConstants();
|
||||
foreach ($aAux as $sName => $sValue) {
|
||||
$aFields[] = array('sName' => $sName, 'sType' => 'system', 'sLabel'=> 'System variable');
|
||||
$aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => 'System variable'
|
||||
);
|
||||
}
|
||||
//we're adding the ping variable to the system list
|
||||
$aFields[] = array('sName' => 'PIN', 'sType' => 'system', 'sLabel' => 'System variable');
|
||||
$aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => 'System variable'
|
||||
);
|
||||
}
|
||||
$aInvalidTypes = array('title', 'subtitle', 'link', 'file', 'button', 'reset', 'submit', 'javascript');
|
||||
$aMultipleSelectionFields = array('listbox', 'checkgroup', 'grid');
|
||||
$aInvalidTypes = array ('title','subtitle','link','file','button','reset','submit','javascript'
|
||||
);
|
||||
$aMultipleSelectionFields = array ('listbox','checkgroup','grid'
|
||||
);
|
||||
if ($bIncMulSelFields != 0) {
|
||||
$aInvalidTypes = array_merge( $aInvalidTypes, $aMultipleSelectionFields );
|
||||
}
|
||||
@@ -393,9 +409,7 @@ class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
foreach ($G_FORM->fields as $k => $v) {
|
||||
if (! in_array( $v->type, $aInvalidTypes )) {
|
||||
if (! in_array( $k, $aFieldsNames )) {
|
||||
$aFields[] = array('sName' => $k,
|
||||
'sType' => $v->type,
|
||||
'sLabel'=> ($v->type != 'grid' ? $v->label : '[ ' . G::LoadTranslation('ID_GRID') . ' ]')
|
||||
$aFields[] = array ('sName' => $k,'sType' => $v->type,'sLabel' => ($v->type != 'grid' ? $v->label : '[ ' . G::LoadTranslation( 'ID_GRID' ) . ' ]')
|
||||
);
|
||||
$aFieldsNames[] = $k;
|
||||
}
|
||||
@@ -410,11 +424,12 @@ class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
|
||||
/**
|
||||
* Function getGridsVars
|
||||
*
|
||||
* @access public
|
||||
* @param eter string $sProcessUID
|
||||
* @return array
|
||||
*/
|
||||
function getGridsVars($sProcessUID)
|
||||
public function getGridsVars ($sProcessUID)
|
||||
{
|
||||
$aFields = array ();
|
||||
$aFieldsNames = array ();
|
||||
@@ -431,7 +446,8 @@ class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
foreach ($G_FORM->fields as $k => $v) {
|
||||
if ($v->type == 'grid') {
|
||||
if (! in_array( $k, $aFieldsNames )) {
|
||||
$aFields[] = array('sName' => $k, 'sXmlForm' => str_replace($sProcessUID . '/', '', $v->xmlGrid));
|
||||
$aFields[] = array ('sName' => $k,'sXmlForm' => str_replace( $sProcessUID . '/', '', $v->xmlGrid )
|
||||
);
|
||||
$aFieldsNames[] = $k;
|
||||
}
|
||||
}
|
||||
@@ -447,23 +463,23 @@ class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
*/
|
||||
class XmlForm_Field_CheckBoxTable extends XmlForm_Field_Checkbox
|
||||
{
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author The Answer
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
function render( $value = NULL , $owner = NULL )
|
||||
public function render ($value = null, $owner = null)
|
||||
{
|
||||
//$optionName = $owner->values['USR_UID'];
|
||||
$optionName = $value;
|
||||
$onclick = (($this->onclick) ? ' onclick="' . G::replaceDataField( $this->onclick, $owner->values ) . '" ' : '');
|
||||
$html ='<input class="FormCheck" id="form['.$this->name.']['.$optionName.']" name="form['.$this->name.
|
||||
']['.$optionName.']" type=\'checkbox\' value="'. $value . '"' . $onclick .
|
||||
'> <span class="FormCheck"></span></input>';
|
||||
$html = '<input class="FormCheck" id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . '][' . $optionName . ']" type=\'checkbox\' value="' . $value . '"' . $onclick . '> <span class="FormCheck"></span></input>';
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user